Skip to content

Twig extension providing social sharing links

Notifications You must be signed in to change notification settings

stof/share-extension

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShareExtension

Twig extension providing social sharing links

Why?

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

Installation

composer require neemzy/share-extension

Usage

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>

Credits

Written by neemzy. Proudly stands on the shoulders of PHP SocialShare.

About

Twig extension providing social sharing links

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%