yii2-sharelinks-widget Yii2 widget for popular social networks "share link" generation

  1. Links
  2. Supported Social Networks
  3. Installation via Composer
  4. Usage Example
  5. Example view file

Yii2 widget for popular social networks "share link" generation

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
use ijackua\sharelinks\ShareLinks;
use \yii\helpers\Html;

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

?>

<div class="socialShareBlock">
	<?=
	Html::a('<i class="icon-facebook-squared"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_FACEBOOK),
		['title' => 'Share to Facebook']) ?>
	<?=
	Html::a('<i class="icon-twitter-squared"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_TWITTER),
		['title' => 'Share to Twitter']) ?>
	<?=
	Html::a('<i class="icon-linkedin-squared"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_LINKEDIN),
		['title' => 'Share to LinkedIn']) ?>
	<?=
	Html::a('<i class="icon-gplus-squared"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_GPLUS),
		['title' => 'Share to Google Plus']) ?>
	<?=
	Html::a('<i class="icon-vkontakte"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_VKONTAKTE),
		['title' => 'Share to Vkontakte']) ?>
	<?=
	Html::a('<i class="icon-tablet"></i>', $this->context->shareUrl(ShareLinks::SOCIAL_KINDLE),
		['title' => 'Send to Kindle']) ?>
</div>
0 0
5 followers
0 downloads
Yii Version: Unknown
License: MIT
Category: User Interface
Developed by: iJackUA
Created on: Mar 31, 2014
Last updated: 10 years ago

Related Extensions