Download the PHP package drmonkeyninja/cakephp-social-share without Composer
On this page you can find all versions of the php package drmonkeyninja/cakephp-social-share. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cakephp-social-share
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
Install using composer: composer require drmonkeyninja/cakephp-social-share:4.*
Then add the following line to your Application.php file to load the plugin.
Also don't forget to add the helper in your AppView
:-
Usage
SocialShareHelper::link()
Returns an HTML link to share the current page for the supplied service. For example to create a link for Facebook:-
You can easily produce a list of links to share to different social networks:-
Supported services:-
- delicious
- digg
- evernote
- friendfeed
- google (Google Bookmarks)
- gplus (Google+)
- newsvine
- slashdot
- stumbleupon
- technorati
- tumblr
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()
Returns an URL for sharing to the supplied service.
SocialShareHelper::fa()
Returns an HTML link just like SocialShare::link()
except the link text will be a relevant Font Awesome icon for the service.
For example:-
Will output:-
If you need to change the icon markup output by fa()
you can override the icon class using icon_class
:-