ruskid/yii2-jssocials

Yii2 JsSocials 包装器

dev-master 2018-08-13 23:14 UTC

This package is auto-updated.

Last update: 2019-12-26 23:42:26 UTC


README

安装

安装此扩展的首选方式是通过 https://getcomposer.org.cn/download/

运行以下命令之一:

php composer.phar require ruskid/yii2-jssocials "dev-master"

或者

"ruskid/yii2-jssocials": "dev-master"

将以下内容添加到您的 composer.json 文件的 require 部分。

为什么?

我不喜欢现有的 yii2 分享解决方案...

  1. yii2-social 只有原生分享和非可定制的按钮
  2. 其他解决方案提供了可定制的按钮,但没有内置弹窗和原生分享支持。

jssocials 是 👍 =)

查看这些用于 pluginOptions

http://js-socials.com/demos/ https://github.com/tabalinas/jssocials

用法

echo JsSocials::widget([
    'theme' => JsSocials::THEME_MINIMA, //4 available themes
    'pluginOptions' => [
        'showLabel' => false,
        'showCount' => false,
        'shareIn' => 'popup',
        'shares' => [
            [
              'share' => 'email',
              'label' => Yii::t('app', 'Email'),
              'to' => 'demmbox@gmail.com',
            ],
            "twitter",
            "facebook", 
            "googleplus", 
            "linkedin",
            "pinterest",
            "stumbleupon", 
            "whatsapp"
        ]
    ]
]);