Font Awesome Helper
The iconic font and CSS toolkit, (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist pkv/yii2-fontawesome "*"
or add, (*4)
"pkv/yii2-fontawesome": "*"
to the require section of your composer.json
file., (*5)
Usage
Once the extension is installed, simply use it in your code by :, (*6)
<?= pkv\fontawesome\Icon::get('twitter')->rotate(pkv\fontawesome\Icon::ROTATE_180)->border() ?>
<?= pkv\fontawesome\Icon::get('twitter', ['rotate' => pkv\fontawesome\Icon::ROTATE_180, 'border' => true]) ?>
<?= pkv\fontawesome\Icon::stack()->in(pkv\fontawesome\Icon::get('cog')->spin())->on(['ban', ['options' => ['class' => 'text-danger']]]) ?>
<?= pkv\fontawesome\Icon::stack()->in(['cog', ['spin' => true]])->on(['ban', ['options' => ['class' => 'text-danger']]]) ?>
<?= pkv\fontawesome\Icon::roster()->add('cog', 'settings')->add('twitter', 'twitter') ?>
Don't forget register asset bundle in view :, (*7)
<?php pkv\fontawesome\AssetBundle::register($this); ?>