wfcreations / yii2-simple-line-icons
Installs: 5 269
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/simple-line-icons: *
This package is auto-updated.
Last update: 2024-10-21 05:53:51 UTC
README
This extension provides a assets bundle with Simple Line Icons for Yii framework 2.0 applications and helper to use icons.
For license information check the LICENSE-file.
Installation
The preferred way to install this extension is through composer.
Either run
composer require "wfcreations/yii2-simple-line-icons:*"
or add
"wfcreations/yii2-simple-line-icons": "*",
to the require
section of your composer.json
file.
Usage
In view
wfcreations\simplelineicons\AssetBundle::register($this);
or as dependency in your main application asset bundle
class AppAsset extends AssetBundle { // ... public $depends = [ // ... '\wfcreations\simplelineicons\AssetBundle' ]; }
Helper
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);