https://github.com/yiimaker/yii2-social-share
With this extension you can share data from your web pages to any social network!
https://github.com/yiimaker/yii2-social-share
social-networks social-share social-share-plugin yii2 yii2-extension yii2-widgets
Last synced: 6 months ago
JSON representation
With this extension you can share data from your web pages to any social network!
- Host: GitHub
- URL: https://github.com/yiimaker/yii2-social-share
- Owner: yiimaker
- License: bsd-3-clause
- Created: 2017-03-19T21:55:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-08-29T22:14:24.000Z (about 1 year ago)
- Last Synced: 2025-03-26T19:04:28.254Z (7 months ago)
- Topics: social-networks, social-share, social-share-plugin, yii2, yii2-extension, yii2-widgets
- Language: PHP
- Homepage:
- Size: 364 KB
- Stars: 48
- Watchers: 9
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://stand-with-ukraine.pp.ua)
Extension for sharing on social networks
[](https://travis-ci.org/yiimaker/yii2-social-share)
[](https://scrutinizer-ci.com/g/yiimaker/yii2-social-share/?branch=master)
[](https://packagist.org/packages/yiimaker/yii2-social-share)
[](https://packagist.org/packages/yiimaker/yii2-social-share)
[](https://packagist.org/packages/yiimaker/yii2-social-share)
[](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)With this extension you can share data from your web pages to any social network!
Features: SEO support, default icons for social networks, easy creation of custom drivers
for other social networks and more!Documentation is at [docs/guide/README.md](docs/guide/README.md).
Extension supports from the box next social network drivers:
* [Facebook](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/Facebook.php)
* [Twitter](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/Twitter.php)
* [+Google](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/GooglePlus.php)
* [LinkedIn](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/LinkedIn.php)
* [Pinterest](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/Pinterest.php)
* [Tumblr](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/Tumblr.php)
* [Trello](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/Trello.php)drivers for messengers:
* [Telegram](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/Telegram.php)
* [Viber](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/Viber.php)
* [WhatsApp](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/WhatsApp.php)and other drivers:
* [Gmail](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/Gmail.php)
* [Yahoo](https://github.com/yiimaker/yii2-social-share/blob/master/src/drivers/Yahoo.php)also you can [create](docs/guide/create-driver.md) your driver, it's very simple!
Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
$ composer require yiimaker/yii2-social-share
```or add
```
"yiimaker/yii2-social-share": "~2.3"
```to the `require` section of your `composer.json`.
Usage
-----Configure social networks in config file
```php
'components' => [
// ...
'socialShare' => [
'class' => \ymaker\social\share\configurators\Configurator::class,
'socialNetworks' => [
'facebook' => [
'class' => \ymaker\social\share\drivers\Facebook::class,
],
],
],
],
```and then call widget in view file
```php
= \ymaker\social\share\widgets\SocialShare::widget([
'configurator' => 'socialShare',
'url' => \yii\helpers\Url::to('absolute/route/to/page', true),
'title' => 'Title of the page',
'description' => 'Description of the page...',
'imageUrl' => \yii\helpers\Url::to('absolute/route/to/image.png', true),
]); ?>
```Tests
-----You can run tests with composer command
```
$ composer tests
```or using following command
```
$ ./vendor/bin/codecept build && ./vendor/bin/codecept run
```Contributing
------------For information about contributing please read [CONTRIBUTING.md](CONTRIBUTING.md).
Sponsoring
----------License
-------[](https://packagist.org/packages/yiimaker/yii2-social-share)
This project is released under the terms of the BSD-3-Clause [license](LICENSE).
Copyright (c) 2017-2021, Volodymyr Kupriienko