black-lamp / yii2-social-networks
Widget for adding social networks for Yii2
Installs: 82
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: >=2.0.4
This package is not auto-updated.
Last update: 2024-11-09 20:56:17 UTC
README
This widget adds links to social networks.
Installation
Run command
composer require black-lamp/yii2-social-networks
or add
"black-lamp/yii2-social-networks": "*"
to the require section of your composer.json.
Add 'SocialNetworks' component to application config
'components' => [ // ... 'socialNetworks' => [ 'class' => bl\socialNetworks\components\SocialNetworks::className(), 'networks' => [ 'vk' => [ 'label' => 'VK', 'link' => 'http://vk.com' ], 'facebook' => [ 'label' => 'Facebook', 'link' => 'https://facebook.com' ], 'instagram' => [ 'label' => 'Instagram', 'link' => 'https://instagram.com' ], ] ], ]
In this component you need to add and configure social network links
Component configuration properties
Configuration properties of networks array
Using
You should use the widget for adding the share links on page
<?= \bl\socialNetworks\SocialNetworks::widget([ 'componentId' => 'socialNetworks' // SocialNetworks component ID from application config ]) ?>
Other extensions
yii2-socialshare - this widget adds share links for social networks