PHPackages                             algsupport/yii2-fontawesome - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. algsupport/yii2-fontawesome

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

algsupport/yii2-fontawesome
===========================

Asset Bundle for Yii2 with Font Awesome

v4.0.1(3y ago)027MITPHPPHP &gt;=8.1.0

Since Nov 7Pushed 3y agoCompare

[ Source](https://github.com/algsupport/yii2-fontawesome)[ Packagist](https://packagist.org/packages/algsupport/yii2-fontawesome)[ RSS](/packages/algsupport-yii2-fontawesome/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

Yii 2 [Font Awesome](http://fortawesome.github.io/Font-Awesome/) Asset Bundle
=============================================================================

[](#yii-2-font-awesome-asset-bundle)

This extension provides an assets bundle with [Font Awesome](https://fontawesome.com/)for [Yii framework 2.0](http://www.yiiframework.com/) applications and helper to use icons.

For license information check the [LICENSE](https://github.com/algsupport/yii2-fontawesome/blob/master/LICENSE)-file.

Support
-------

[](#support)

- [GutHub issues](https://github.com/algsupport/yii2-fontawesome/issues)

Fontawesome version
-------------------

[](#fontawesome-version)

Version of font-awesomeVersion of extension6.\*~4.0Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](https://getcomposer.org/).

Either run

```
composer require "algsupport/yii2-fontawesome:~4.0"
```

or add

```
"algsupport/yii2-fontawesome": "~4.0",

```

to the `require` section of your `composer.json` file.

Usage with fa pro version
-------------------------

[](#usage-with-fa-pro-version)

### CDN

[](#cdn)

Create a new kit here -

Add your kit in the `assetManager` config under `components` :

```
return [
    // ...
    'components' => [
        'assetManager' => [
            'bundles' => [
                'algsupport\yii\fontawesome\CdnProAssetBundle' => [
                    'js' => [
                        'your kit',
                    ]
                ],
            ],
        ],
    ],
];
```

Add `CdnProAssetBundle` as depends of your app asset bundle:

```
class AppAsset extends AssetBundle
{
	// ...

	public $depends = [
		// ...
		'algsupport\yii\fontawesome\CdnProAssetBundle'
	];
}
```

Or inject `CdnProAssetBundle` in your view:

```
\algsupport\yii\fontawesome\CdnProAssetBundle::register($this);
```

### NPM

[](#npm)

Install npm package of font:

```
npm install @fortawesome/fontawesome-pro

```

or

```
yarn add @fortawesome/fontawesome-pro

```

And add `NpmProAssetBundle` as depends of your app asset bundle:

```
class AppAsset extends AssetBundle
{
	// ...

	public $depends = [
		// ...
		'algsupport\yii\fontawesome\NpmProAssetBundle'
	];
}
```

Or inject `NpmProAssetBundle` in your view:

```
algsupport\yii\fontawesome\NpmProAssetBundle::register($this);
```

### Optional

[](#optional)

In order for do not install the free version of the font-awesome package, you can add it to the `replace` section of `composer.json`.

```
  "replace": {
    "fortawesome/font-awesome": "*"
  },

```

Usage with fa free version
--------------------------

[](#usage-with-fa-free-version)

### CDN

[](#cdn-1)

Add `CdnFreeAssetBundle` as depends of your app asset bundle:

```
class AppAsset extends AssetBundle
{
	// ...

	public $depends = [
		// ...
		'algsupport\yii\fontawesome\CdnFreeAssetBundle'
	];
}
```

Or inject `CdnFreeAssetBundle` in your view:

```
algsupport\yii\fontawesome\CdnFreeAssetBundle::register($this);
```

Composer
========

[](#composer)

Free version of package `fortawesome/font-awesome` already installed in vendor.

Add `NpmFreeAssetBundle` as depends of your app asset bundle:

```
class AppAsset extends AssetBundle
{
	// ...

	public $depends = [
		// ...
		'algsupport\yii\fontawesome\NpmFreeAssetBundle'
	];
}
```

Or inject `NpmFreeAssetBundle` in your view:

```
algsupport\yii\fontawesome\NpmFreeAssetBundle::register($this);
```

Class reference
---------------

[](#class-reference)

Namespace: `algsupport\yii\fontawesome`;

### Class `FAB`, `FAL`, `FAR`, `FAS` or `FontAwesome`

[](#class-fab-fal-far-fas-or-fontawesome)

- `static FAR::icon($name, $options=[])` - Creates an [`component\Icon`](#class-componenticon) that can be used to FontAwesome html icon
    - `$name` - name of icon in font awesome set.
    - `$options` - additional attributes for `i.fa` html tag.
- `static FAR::stack($name, $options=[])` - Creates an [`component\Stack`](#class-componentstack) that can be used to FontAwesome html icon
    - `$options` - additional attributes for `span.fa-stack` html tag.

### Class `component\Icon`

[](#class-componenticon)

- `(string)$Icon` - render icon
- `$Icon->addCssClass($value)` - add to html tag css class in `$value`
    - `$value` - name of css class
- `$Icon->inverse()` - add to html tag css class `fa-inverse`
- `$Icon->spin()` - add to html tag css class `fa-spin`
- `$Icon->fixedWidth()` - add to html tag css class `fa-fw`
- `$Icon->ul()` - add to html tag css class `fa-ul`
- `$Icon->li()` - add to html tag css class `fa-li`
- `$Icon->border()` - add to html tag css class `fa-border`
- `$Icon->pullLeft()` - add to html tag css class `pull-left`
- `$Icon->pullRight()` - add to html tag css class `pull-right`
- `$Icon->size($value)` - add to html tag css class with size
    - `$value` - size value (variants: `FA::SIZE_LARGE`, `FA::SIZE_2X`, `FA::SIZE_3X`, `FA::SIZE_4X`, `FA::SIZE_5X`)
- `$Icon->rotate($value)` - add to html tag css class with rotate
    - `$value` - rotate value (variants: `FA::ROTATE_90`, `FA::ROTATE_180`, `FA::ROTATE_270`)
- `$Icon->flip($value)` - add to html tag css class with rotate
    - `$value` - flip value (variants: `FA::FLIP_HORIZONTAL`, `FA::FLIP_VERTICAL`)

### Class `component\Stack`

[](#class-componentstack)

- `(string)$Stack` - render icon stack
- `$Stack->icon($icon, $options=[])` - set icon for stack
    - `$icon` - name of icon or `component\Icon` object
    - `$options` - additional attributes for icon html tag.
- `$Stack->icon($icon, $options=[])` - set background icon for stack
    - `$icon` - name of icon or `component\Icon` object
    - `$options` - additional attributes for icon html tag.

Helper examples
---------------

[](#helper-examples)

```
use algsupport\yii\fontawesome\FAS;
// or (only in pro version https://fontawesome.com/pro)
// use algsupport\yii\fontawesome\FAR;
// use algsupport\yii\fontawesome\FAL;
// use algsupport\yii\fontawesome\FAB;

// normal use
echo FAS::icon('home'); //

// shortcut
echo FAS::i('home'); //

// icon with additional attributes
echo FAS::icon(
    'arrow-left',
    ['class' => 'big', 'data-role' => 'arrow']
); //

// icon in button
echo Html::submitButton(
    Yii::t('app', '{icon} Save', ['icon' => FAS::icon('check')])
); //  Save

// icon with additional methods
echo FAS::icon('cog')->inverse();    //
echo FAS::icon('cog')->spin();       //
echo FAS::icon('cog')->fixedWidth(); //
echo FAS::icon('cog')->li();         //
echo FAS::icon('cog')->border();     //
echo FAS::icon('cog')->pullLeft();   //
echo FAS::icon('cog')->pullRight();  //

// icon size
echo FAS::icon('cog')->size(FAS::SIZE_3X);
// values: FAS::SIZE_LARGE, FAS::SIZE_2X, FAS::SIZE_3X, FAS::SIZE_4X, FAS::SIZE_5X
//

// icon rotate
echo FAS::icon('cog')->rotate(FAS::ROTATE_90);
// values: FAS::ROTATE_90, FAS::ROTATE_180, FAS::ROTATE_180
//

// icon flip
echo FAS::icon('cog')->flip(FAS::FLIP_VERTICAL);
// values: FAS::FLIP_HORIZONTAL, FAS::FLIP_VERTICAL
//

// icon with multiple methods
echo FAS::icon('cog')
        ->spin()
        ->fixedWidth()
        ->pullLeft()
        ->size(FAS::SIZE_LARGE);
//

// icons stack
echo FAS::stack()
        ->icon('twitter')
        ->on('square-o');
//
//
//
//

// icons stack with additional attributes
echo FAS::stack(['data-role' => 'stacked-icon'])
     ->on(FAS::Icon('square')->inverse())
     ->icon(FAS::Icon('cog')->spin());
//
//
//
//

// Stacking text and icons
echo FAS::stack()
     ->on(FAS::Icon('square'))
     ->text('1');
//
//
//   1
//

// Stacking text and icons with options
echo FAS::stack()
     ->on(FAS::Icon('square'))
     ->text('1', ['tag'=>'strong', 'class'=>'stacked-text']);
//
//
//   1
//
// Now you can add some css for vertical text positioning:
.stacked-text { margin-top: .3em; }

// unordered list icons
echo FAS::ul(['data-role' => 'unordered-list'])
     ->item('Bullet item', ['icon' => 'circle'])
     ->item('Checked item', ['icon' => 'check']);
//
//   Bullet item
//   Checked Item
//

// autocomplete icons name in IDE
echo FAS::icon(FAS::_COG);
echo FAS::icon(FAS::_DESKTOP);
echo FAS::stack()
     ->on(FAS::_CIRCLE_O)
     ->icon(FAS::_TWITTER);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1281d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ace2d281a54f804ff421c5061bc5a588502d2f3c3f4cd62f5d989b4dc1e1ad3?d=identicon)[algsupport](/maintainers/algsupport)

---

Top Contributors

[![rmrevin](https://avatars.githubusercontent.com/u/803507?v=4)](https://github.com/rmrevin "rmrevin (181 commits)")[![loveorigami](https://avatars.githubusercontent.com/u/98164?v=4)](https://github.com/loveorigami "loveorigami (4 commits)")[![albertborsos](https://avatars.githubusercontent.com/u/7307145?v=4)](https://github.com/albertborsos "albertborsos (2 commits)")[![f1amy](https://avatars.githubusercontent.com/u/27062841?v=4)](https://github.com/f1amy "f1amy (2 commits)")[![Faryshta](https://avatars.githubusercontent.com/u/2029247?v=4)](https://github.com/Faryshta "Faryshta (1 commits)")[![haqqi](https://avatars.githubusercontent.com/u/831763?v=4)](https://github.com/haqqi "haqqi (1 commits)")[![Isitar](https://avatars.githubusercontent.com/u/16210003?v=4)](https://github.com/Isitar "Isitar (1 commits)")[![makroxyz](https://avatars.githubusercontent.com/u/2069949?v=4)](https://github.com/makroxyz "makroxyz (1 commits)")[![marc7000](https://avatars.githubusercontent.com/u/1118837?v=4)](https://github.com/marc7000 "marc7000 (1 commits)")[![mauriziocingolani](https://avatars.githubusercontent.com/u/4015015?v=4)](https://github.com/mauriziocingolani "mauriziocingolani (1 commits)")[![mervick](https://avatars.githubusercontent.com/u/2429298?v=4)](https://github.com/mervick "mervick (1 commits)")[![oudingfan](https://avatars.githubusercontent.com/u/2810552?v=4)](https://github.com/oudingfan "oudingfan (1 commits)")[![prawee](https://avatars.githubusercontent.com/u/3203937?v=4)](https://github.com/prawee "prawee (1 commits)")[![Arnaud-G1](https://avatars.githubusercontent.com/u/8536657?v=4)](https://github.com/Arnaud-G1 "Arnaud-G1 (1 commits)")[![algsupport](https://avatars.githubusercontent.com/u/8190132?v=4)](https://github.com/algsupport "algsupport (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

bundleyiiassetfontawesome

### Embed Badge

![Health badge](/badges/algsupport-yii2-fontawesome/health.svg)

```
[![Health](https://phpackages.com/badges/algsupport-yii2-fontawesome/health.svg)](https://phpackages.com/packages/algsupport-yii2-fontawesome)
```

###  Alternatives

[rmrevin/yii2-fontawesome

Asset Bundle for Yii2 with Font Awesome

1474.0M134](/packages/rmrevin-yii2-fontawesome)[nizsheanez/yii2-asset-converter

Less, Sass, Scss and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

64167.5k6](/packages/nizsheanez-yii2-asset-converter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
