PHP code example of drmonkeyninja / cakephp-social-share

1. Go to this page and download the library: Download drmonkeyninja/cakephp-social-share library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

drmonkeyninja / cakephp-social-share example snippets


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

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

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

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

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

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

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