PHPackages                             drmonkeyninja/cakephp-social-share - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. drmonkeyninja/cakephp-social-share

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

drmonkeyninja/cakephp-social-share
==================================

CakePHP helper for creating social share/bookmark links

4.0.0(5y ago)34103.3k12[2 issues](https://github.com/drmonkeyninja/cakephp-social-share/issues)MITPHP

Since Mar 1Pushed 5y ago7 watchersCompare

[ Source](https://github.com/drmonkeyninja/cakephp-social-share)[ Packagist](https://packagist.org/packages/drmonkeyninja/cakephp-social-share)[ Docs](https://github.com/drmonkeyninja/cakephp-social-share)[ RSS](/packages/drmonkeyninja-cakephp-social-share/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (26)Used By (0)

CakePHP Social Share
====================

[](#cakephp-social-share)

[![Latest Stable Version](https://camo.githubusercontent.com/3435f8be27e35bb48c11f8d138c0110001d8ac943bae5b4850109c9bbb107740/68747470733a2f2f706f7365722e707567782e6f72672f64726d6f6e6b65796e696e6a612f63616b657068702d736f6369616c2d73686172652f762f737461626c65)](https://packagist.org/packages/drmonkeyninja/cakephp-social-share) [![License](https://camo.githubusercontent.com/2317deaa45dffc42ce0ba3f93eb4955d3c85e6f93b19edf4b4f301d4e7328fd0/68747470733a2f2f706f7365722e707567782e6f72672f64726d6f6e6b65796e696e6a612f63616b657068702d736f6369616c2d73686172652f6c6963656e73652e737667)](https://packagist.org/packages/drmonkeyninja/cakephp-social-share) [![Build Status](https://camo.githubusercontent.com/2dfeb75c716f8ac01b0c811368c1f6ed724825db8012f36d33c13897e05bc1d6/68747470733a2f2f7472617669732d63692e6f72672f64726d6f6e6b65796e696e6a612f63616b657068702d736f6369616c2d73686172652e737667)](https://travis-ci.org/drmonkeyninja/cakephp-social-share) [![Total Downloads](https://camo.githubusercontent.com/9617c03b720bd37af827a82e827c7c7a3b515a82709e9e834292a3ef8f1716fb/68747470733a2f2f706f7365722e707567782e6f72672f64726d6f6e6b65796e696e6a612f63616b657068702d736f6369616c2d73686172652f646f776e6c6f616473)](https://packagist.org/packages/drmonkeyninja/cakephp-social-share)

This plugin provides a CakePHP View helper for creating links to share content on numerous social networks and bookmarking sites.

The aim of the plugin is to keep things simple. It doesn't come packaged with any JavaScript and I leave design decisions up to you. You can choose whether you want to use text, images, sprites or an icon font for your links.

Social Share currently supports Delicious, Digg, Evernote, Facebook, Friend Feed, Google Bookmarks, Google+, LinkedIn, Newsvine, Pinterest, Pocket, Reddit Slashdot, simple email, StumbleUpon, Technorati, Tumblr, Twitter and WhatsApp.

**Note**: This branch is for CakePHP 4.x.

Installation
------------

[](#installation)

Install using composer: `composer require drmonkeyninja/cakephp-social-share:4.*`

Then add the following line to your Application.php file to load the plugin.

```
$this->addPlugin(\SocialShare\Plugin::class);
```

Also don't forget to add the helper in your `AppView`:-

```
$this->loadHelper('SocialShare.SocialShare');
```

Usage
-----

[](#usage)

### SocialShareHelper::link()

[](#socialsharehelperlink)

```
SocialShareHelper::link(string $service, string $title, mixed $url = null, array $options = [])

```

Returns an HTML link to share the current page for the supplied service. For example to create a link for Facebook:-

```
echo $this->SocialShare->link(
    'facebook',
    __('Share on Facebook')
);
```

You can easily produce a list of links to share to different social networks:-

```
$services = [
    'facebook' => __('Share on Facebook'),
    'gplus' => __('Share on Google+'),
    'linkedin' => __('Share on LinkedIn'),
    'twitter' => __('Share on Twitter')
];

echo '';
foreach ($services as $service => $linkText) {
    echo '' . $this->SocialShare->link(
        $service,
        $linkText
    ) . '';
}
echo '';
```

Supported services:-

- delicious
- digg
- email
- evernote
- facebook
- friendfeed
- google (Google Bookmarks)
- gplus (Google+)
- linkedin
- newsvine
- pinterest
- pocket
- reddit
- slashdot
- stumbleupon
- technorati
- tumblr
- twitter
- whatsapp

You can pass a URL or a routing array as the third parameter for the URL you want to share.

`$options` supports the same options as `HtmlHelper::link()` as well as a 'text' option for a page title you want to include when sharing the URL. For Pinterest there is an additional 'image' option for a URL to an image to share.

### SocialShareHelper::href()

[](#socialsharehelperhref)

```
SocialShareHelper::href(string $service, mixed $url = null, array $options = [])

```

Returns an URL for sharing to the supplied service.

### SocialShareHelper::fa()

[](#socialsharehelperfa)

```
SocialShareHelper::fa(string $service, mixed $url = null, array $options = [])

```

Returns an HTML link just like `SocialShare::link()` except the link text will be a relevant Font Awesome icon for the service.

For example:-

```
echo $this->SocialShare->fa(
    'facebook',
    'http://example.com'
);
```

Will output:-

```

```

If you need to change the icon markup output by `fa()` you can override the icon class using `icon_class`:-

```
echo $this->SocialShare->fa(
    'facebook',
    null,
    ['icon_class' => 'fa fa-facebook-square']
);
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 98.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~104 days

Recently: every ~77 days

Total

21

Last Release

2012d ago

Major Versions

2.0.3.0 → 3.x-dev2015-05-08

2.0.4.0 → 3.0.0.02015-05-08

2.0.4.1 → 3.0.22016-07-12

2.0.4.2 → 3.1.02018-02-08

2.0.4.4 → 4.x-dev2020-07-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f481390bacd8d21d0caec9b0516971dad97f9f50fa8c8010460860ff76f6e8d?d=identicon)[drmonkeyninja](/maintainers/drmonkeyninja)

---

Top Contributors

[![drmonkeyninja](https://avatars.githubusercontent.com/u/357623?v=4)](https://github.com/drmonkeyninja "drmonkeyninja (66 commits)")[![marquilio7](https://avatars.githubusercontent.com/u/2878961?v=4)](https://github.com/marquilio7 "marquilio7 (1 commits)")

---

Tags

cakephpfacebooklinkedintwitterhelpercakephp

### Embed Badge

![Health badge](/badges/drmonkeyninja-cakephp-social-share/health.svg)

```
[![Health](https://phpackages.com/badges/drmonkeyninja-cakephp-social-share/health.svg)](https://phpackages.com/packages/drmonkeyninja-cakephp-social-share)
```

###  Alternatives

[dereuromark/cakephp-calendar

A CakePHP plugin to easily create calendars.

1646.8k1](/packages/dereuromark-cakephp-calendar)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

2988.9k3](/packages/dereuromark-cakephp-dto)[dereuromark/cakephp-url-cache

CakePHP plugin to speed up URL reverse lookup

24117.2k](/packages/dereuromark-cakephp-url-cache)[torifat/cake-menu_builder

A dynamic menu building helper for CakePHP 2.x

755.6k](/packages/torifat-cake-menu-builder)[codaxis/cakephp-bootstrap3-helpers

CakePHP highly configurable helpers for Bootstrap 3 framework.

4111.5k2](/packages/codaxis-cakephp-bootstrap3-helpers)[markstory/geshi

CakePHP plugin that integrates with Geshi Syntax highlighter.

252.3k1](/packages/markstory-geshi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
