This extension provides a assets bundle with Simple Line Icons for Yii framework 2.0 applications and helper to use icons., (*1)
For license information check the LICENSE-file., (*2)
The preferred way to install this extension is through composer., (*4)
Either run, (*5)
composer require "wfcreations/yii2-simple-line-icons:*"
or add, (*6)
"wfcreations/yii2-simple-line-icons": "*",
to the require
section of your composer.json
file., (*7)
In view, (*8)
wfcreations\simplelineicons\AssetBundle::register($this);
or as dependency in your main application asset bundle, (*9)
class AppAsset extends AssetBundle { // ... public $depends = [ // ... '\wfcreations\simplelineicons\AssetBundle' ]; }
use wfcreations\simplelineicons\SLI; echo SLI::icon('home'); // <i class="icon-home"></i> echo SLI::icon( 'home', ['data-role' => 'home'] ); // <i class="home" data-role="home"></i> echo Html::submitButton( Yii::t('app', '{icon} Login', ['icon' => SLI::icon('login')]) ); // <button type="submit"><i class="icon-login"></i> Login</button> // autocomplete icons name in IDE echo SLI::icon(SLI::_USER_FEMALE); echo SLI::icon(SLI::_USER_FOLLOW);