定制 webulla/yii2-sharelinks 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webulla/yii2-sharelinks

Composer 安装命令:

composer require webulla/yii2-sharelinks

包简介

Yii2 widget for social networks or email sharing

README 文档

README

Widget for posting links to publications on social networks.

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require "webulla/yii2-sharelinks":"*"

Usage

First, you need to connect the widget:

use webulla\sharelinks\ShareLinks;

Then, you can use widget with default configurations for sharing via facebook, twitter, vkontakte and email:

echo ShareLinks::widget([
	'links' => [
		'facebook' => [],
		'twitter' => [],
		'vkontakte' => [],
		'email' => [],
	]
]);

Or, you can override any default settings:

echo ShareLinks::widget([
	// page url (default: Yii::$app->request->absoluteUrl)
	'url' => 'http://yoursite.com/page',

	// page title (default: Yii::$app->view->title)
	'title' => 'Page title',

	// page description
	'body' => 'Page description',

	// links collection
	'links' => [
        // default service
		'facebook' => ['label' => 'Facebook'],

		// custom service in popup window
		'service' => ['label' => 'Share via Service',
		    'url' => 'http://service.com/share?title={title}&body={body}&url={url}'
        ],

		// custom service in new tab
		'service-manual' => ['label' => 'Share via Service',
		    'url' => 'http://service.com/share?title={title}&body={body}&url={url}',
            'options' => [
                'class' => 'share-link-manual',  // disable on click event listening
                'target' => '_blank', // open link in new tab
            ]
        ],
	]
]);

Predefined services:

$services = [
	'twitter' => ['label' => 'Share via twitter'],
	'facebook' => ['label' => 'Share via Facebook'],
	'vkontakte' => ['label' => 'Share via Vkontakte'],
	'gplus' => ['label' => 'Share via Google Plus'],
	'linkedin' => ['label' => 'Share via Linkedin'],
	'kindle' => ['label' => 'Share via Kindle'],
	'email' => ['label' => 'Share via E-mail'],
];

统计信息

  • 总下载量: 167
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-19