Twig extension providing social sharing links
Using this library instead of widgets provided by social platforms will allow you to get rid of:
- JavaScript execution timing issues
- Appearance constraints
- Abusive user tracking
composer require neemzy/share-extension
use Neemzy\Twig\Extension\ShareExtension;
$twig->addExtension(ShareExtension::getInstance());
<a href="{{ twitter(my_url, 'Some text') }}">Share on Twitter</a>
<a href="{{ facebook(my_url) }}">Share on Facebook</a>
<a href="{{ pinterest(my_url, my_media_url) }}">Share on Pinterest</a>
<a href="{{ tumblr(my_url, 'Some title', 'Some description') }}">Share on Tumblr</a>
<a href="{{ googleplus(my_url) }}">Share on Google+</a>
Written by neemzy. Proudly stands on the shoulders of PHP SocialShare.