blackho1e / yii2-fontawesome
fontawesome-asset for Yii2
Installs: 8
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4.0
- fortawesome/font-awesome: *
- yiisoft/yii2: 2.0.*
This package is not auto-updated.
Last update: 2025-01-08 21:47:34 UTC
README
Installation
The preferred way to install this extension is through composer.
To install, either run
$ php composer.phar require "blackho1e/yii2-fontawesome" "*"
or add
"blackho1e/yii2-fontawesome" : "*"
to the require
section of your composer.json
file.
Assets
To include Font Awesome assets, you should register it in view :
\blackho1e\fontawesome\FontAwesomeAsset::register($this);
Or as dependency in your app asset bundle :
public $depends = [ 'blackho1e\fontawesome\FontAwesomeAsset', ];
Usage
use blackho1e\fontawesome\FontAwesome as FA; // home icon : <i class="fa fa-home"></i> echo FA::icon('home'); // 2x home icon : <i class="fa fa-home fa-2x"></i> echo FA::icon('home 2x'); // fixed width home icon : <i class="fa fa-home fa-fw"></i> echo FA::icon('home fw');