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


In Google Chrome you can open Dev Tools for Dev Tools. Open it in separate window and then Ctrl + Shift + J.



Redis 2.8.0 released! At the first look has couple of very promising things to play aroud with

  • new *SCAN commands for pattern filering (like scan 0 MATCH key:1*)
  • Pub/Sub notification on expire and data manipulation events - that brings some ideas of pseudo data consistency implementation