Either run
composer require "rmrevin/yii2-ionicon:~1.2"
or add in composer.json
:
{
"require": {
"rmrevin/yii2-ionicon": "~1.2"
}
}
In view
<?
// ...
rmrevin\yii\ionicon\AssetBundle::register($this);
or as dependency in your asset bundle
<?
// ...
class AppAsset extends AssetBundle
{
// ...
public $depends = [
// ...
'\rmrevin\yii\ionicon\AssetBundle'
];
}
use rmrevin\yii\ionicon\Ion;
echo Ion::icon('social-twitter');
// <i class="ion-social-twitter"></i>
echo Ion::icon('social-twitter', ['class' => 'big', 'data-role' => 'social-button']);
// <i class="big ion-social-twitter" data-role="social-button"></i>
echo Html::submitButton(Yii::t('app', '{check} Tweet', ['check' => Ion::icon('social-twitter')]));
// <button type="submit"><i class="ion-social-twitter"></i> Tweet</button>
// autocomplete in IDE
echo Ion::icon(Ion::_SOCIAL_TWITTER);
echo Ion::icon(Ion::_ANDROID_BULB);
Ion::$cssPrefix = 'ionicon';
echo Ion::icon('social-twitter');
// <i class="ionicon-social-twitter"></i>
Comments