PHP code example of rmrevin / yii2-socicon

1. Go to this page and download the library: Download rmrevin/yii2-socicon 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/ */

    

rmrevin / yii2-socicon example snippets


<?
// ...

rmrevin\yii\socicon\AssetBundle::register($this);


<?
// ...

class AppAsset extends AssetBundle
{
	// ...

	public $depends = [
		// ...
		'\rmrevin\yii\socicon\AssetBundle'
	];
}



use rmrevin\yii\socicon\SI;

echo SI::icon('twitter');
// <i class="socicon socicon-twitter"></i>
echo SI::icon('twitter', ['class' => 'big', 'data-role' => 'social-button']);
// <i class="big socicon socicon-twitter" data-role="social-button"></i>
echo Html::submitButton(Yii::t('app', '{check} Tweet', ['check' => SI::icon('twitter')]));
// <button type="submit"><i class="socicon socicon-twitter"></i> Tweet</button>

// autocomplete in IDE
echo SI::icon(SI::_TWITTER);
echo SI::icon(SI::_DISQUS);

SI::$cssPrefix = 'si';

echo SI::icon('twitter');
// <i class="si si-twitter"></i>