yii2-sharelinks-widget

Yii2 widget for popular social networks "share link" generation

  • 所有者: iJackUA/yii2-sharelinks-widget
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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>

主要指标

概览
名称与所有者iJackUA/yii2-sharelinks-widget
主编程语言PHP
编程语言PHP (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2014-03-15 16:55:14
推送于2016-08-24 13:30:06
最后一次提交2016-08-24 16:30:05
发布数4
最新版本名称1.0.3 (发布于 )
第一版名称1.0.0 (发布于 )
用户参与
星数12
关注者数6
派生数7
提交数16
已启用问题?
问题数6
打开的问题数2
拉请求数2
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?