PHP code example of elgorm / yii2-yandex-sharebuttons

1. Go to this page and download the library: Download elgorm/yii2-yandex-sharebuttons library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

elgorm / yii2-yandex-sharebuttons example snippets


use elgorm\sharebuttons\ShareButtons;

...
<?= ShareButtons::widget(
    [
        'clientOptions'=>[
            'services' => 'facebook,vkontakte,twitter', //attributes from official without preffix "data-"
            'size' => 's',
            'lang' => 'en',
            'title:twitter' => 'Yandex', //a different title for the different networks
            'id' => 'id1', // not added preffix data-
            'class' => 'class1 class2', // not added preffix data-
            'tag' => 'span', //default "div" 
        ]
    ]
);