yidas/yii2-fontawesome

Font Awesome Asset Bundle for Yii2 framework

Installs: 40 881

Dependents: 9

Suggesters: 0

Security: 0

Stars: 7

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

5.0.0 2019-10-05 23:16 UTC

This package is auto-updated.

Last update: 2024-02-06 08:45:24 UTC


README

68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f7468756d622f382f38392f466f6e745f417765736f6d655f355f6c6f676f5f626c61636b2e7376672f32323070782d466f6e745f417765736f6d655f355f6c6f676f5f626c61636b2e7376672e706e67

Font Awesome Extension for Yii 2


Font Awesome Asset Bundle for Yii2 framework

Latest Stable Version License Total Downloads Monthly Downloads

This is the Font Awesome extension for Yii framework 2.0. It encapsulates Font Awesome distribution assets and thus makes using Font Awesome in Yii applications extremely easy.

INSTALLATION

The preferred install way is through Composer:

composer require yidas/yii2-fontawesome

Or you could edit composer.json with adding package in require section then run composer update.

"yidas/yii2-fontawesome": "~2.0.0"

CONFIGURATION

Register or depend Asset into your application:

yidas\yii\fontawesome\FontawesomeAsset

For eaxmple, to register Font Awesome assets in view :

\yidas\yii\fontawesome\FontawesomeAsset::register($this);

Or as dependency in your app asset bundle :

namespace app\assets;
use yii\web\AssetBundle;
class AppAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'css/site.css',
    ];
    public $js = [
    ];
    public $depends = [
        'yii\web\YiiAsset',
        'yii\bootstrap\BootstrapAsset',
        'yidas\yii\fontawesome\FontawesomeAsset',
    ];
}

CDN Asset Mode

You could switch Asset to use CDN distribution by configuring config file:

'components' => [
    'assetManager' => [
        'bundles' => [
            'yidas\yii\fontawesome\FontawesomeAsset' => [
                'cdn' => true,
                // 'cdnVersion' => '5.11.0',
            ],
        ],
    ],
],

Specify a CDN source

You could also specify CDN source you like:

'assetManager' => [
    'bundles' => [
        'yidas\yii\fontawesome\FontawesomeAsset' => [
            'cdn' => true,
            'cdnCSS' => ['//maxcdn.bootstrapcdn.com/font-awesome/5.11.0/css/font-awesome.min.css'],
        ],
    ],
],

USAGE

Version Control

Update dependent packages

composer update yidas/yii2-fontawesome

Update newest Font-Awesome version

composer update fortawesome/font-awesome

Specify a Font-Awesome version

composer require fortawesome/font-awesome 5.11.0