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


Did you know ? Vagrant (1.5+) "Error: Remote connection disconnect. Retrying..." while loading is not a bug. It just try to detect when VM is loaded. Yep... very confusing.



Slick - really looks like "the last JS carousel you'll ever need". Responsive, touch-enabled, mouse-dragging, dynamic add/remove.



Tried yii2-pjax widget on blog. A few moment of work and you can navigate through Notes without page reload. Really cool!