yii2-sharelinks-widget

Yii2 widget for popular social networks "share link" generation

  • Owner: iJackUA/yii2-sharelinks-widget
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

yii2-sharelinks-widget

Yii2 widget for popular social networks "share link" generation

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

in template file use

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

Example custom view file

This eaxmple uses custom icons from Fontello, but you can make it what ever you want and customize what links do you need and what not.
Your @app/views/mypath/shareLinks.php file could look like

<?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>

Main metrics

Overview
Name With OwneriJackUA/yii2-sharelinks-widget
Primary LanguagePHP
Program languagePHP (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2014-03-15 16:55:14
Pushed At2016-08-24 13:30:06
Last Commit At2016-08-24 16:30:05
Release Count4
Last Release Name1.0.3 (Posted on )
First Release Name1.0.0 (Posted on )
用户参与
Stargazers Count12
Watchers Count6
Fork Count7
Commits Count16
Has Issues Enabled
Issues Count6
Issue Open Count2
Pull Requests Count2
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private