ShareLinks - Yii2 widget for "share this page" links in social networks > stdout.in Ievgen Kuzminov IT blog

ShareLinks - Yii2 widget for "share this page" links in social networks

Mar 15, 2014, 5:55:30 PM

share links

Supported Social Networks

Installation via Composer

add to require section of your composer.json "ijackua/yii2-sharelinks-widget": "dev-master" and run composer update

Usage Example

\ijackua\sharelinks\ShareLinks::widget(
 [
  'viewName' => '@app/views/mypath/shareLinks.php' //custom view file for you links appearance
 ]
);

Example view file

it uses custom icons from Fontello, but you can make it what ever you want and customize what links do you need adn what not ~~~php <?php use ijackua\sharelinks\ShareLinks; use \yii\helpers\Html;

/* @var yii\base\View $this */

?>

', $this->context->shareUrl(ShareLinks::SOCIAL_FACEBOOK), ['title' => 'Share to Facebook']) ?> ', $this->context->shareUrl(ShareLinks::SOCIAL_TWITTER), ['title' => 'Share to Twitter']) ?> ', $this->context->shareUrl(ShareLinks::SOCIAL_LINKEDIN), ['title' => 'Share to LinkedIn']) ?> ', $this->context->shareUrl(ShareLinks::SOCIAL_GPLUS), ['title' => 'Share to Google Plus']) ?> ', $this->context->shareUrl(ShareLinks::SOCIAL_VKONTAKTE), ['title' => 'Share to Vkontakte']) ?> ', $this->context->shareUrl(ShareLinks::SOCIAL_KINDLE), ['title' => 'Send to Kindle']) ?>

##Links

* [GitHub](https://github.com/iJackUA/yii2-sharelinks-widget)
* [Packagist](https://packagist.org/packages/ijackua/yii2-sharelinks-widget)
comments powered by Disqus
Ievgen
Kuzminov "iJackUA"
Web Team Lead
at MobiDev (Kharkiv, Ukraine)
Code in Ruby and Elixir, but still love PHP. Explore ES6 and Vue.js. Explore databases, use Ubuntu and MacOS, think about IT people and management

Notes


Have you noticed? Nowadays nobody is doing a New JavaScript framework 😧 These days are over... Everybody is doing their brand new blockchain 😜