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


Linkify - jQuery plugin for finding URLs in plain-text and converting them to HTML links. It works with all valid URLs and email addresses



Remodal - flat, responsive, lightweight, fast, easy customizable modal window jquery plugin with declarative state notation and hash tracking



Giving a try to Ubuntu 14.04 - so far it's ok. More stable and refined. But it seem to have problems with Cinnamon 2 installation. Oh fine... will wait for Linux MInt 17 to use on my Work machine



Updated blog. Mostly "under-the-hood" changes according to latest Yii2 state, some CSS and server optimisations. In case of any issues please feel free to comment here