PHPackages                             devmastersbv/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. devmastersbv/yii2-fontawesome

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

devmastersbv/yii2-fontawesome
=============================

Asset Bundle for Yii2 with Font Awesome

2.17.1(9y ago)0155MITPHPPHP &gt;=5.4.0

Since Feb 27Pushed 9y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (51)Used By (0)

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

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

This extension provides a assets bundle with [Font Awesome](http://fortawesome.github.io/Font-Awesome/)for [Yii framework 2.0](http://www.yiiframework.com/) applications and helper to use icons.

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

[![License](https://camo.githubusercontent.com/7688a06a560f3527002c704479603ed881eb9f7e5e60f3f370cd9820bb229ce0/68747470733a2f2f706f7365722e707567782e6f72672f726d726576696e2f796969322d666f6e74617765736f6d652f6c6963656e73652e737667)](https://packagist.org/packages/rmrevin/yii2-fontawesome)[![Latest Stable Version](https://camo.githubusercontent.com/871110b885a33a38f9f55d87759d3e0dbd462ef1b6de0160e9e4c385c16c7b42/68747470733a2f2f706f7365722e707567782e6f72672f726d726576696e2f796969322d666f6e74617765736f6d652f762f737461626c652e737667)](https://packagist.org/packages/rmrevin/yii2-fontawesome)[![Latest Unstable Version](https://camo.githubusercontent.com/59c1d1cdc58c1ba399829679ae8dad499f9ebc020c7ab0994dbf2007c27038d0/68747470733a2f2f706f7365722e707567782e6f72672f726d726576696e2f796969322d666f6e74617765736f6d652f762f756e737461626c652e737667)](https://packagist.org/packages/rmrevin/yii2-fontawesome)[![Total Downloads](https://camo.githubusercontent.com/8e77690f28ae570e92685f789b9ab95fa0ea8cd2335db17eccd2a65d50c72e50/68747470733a2f2f706f7365722e707567782e6f72672f726d726576696e2f796969322d666f6e74617765736f6d652f646f776e6c6f6164732e737667)](https://packagist.org/packages/rmrevin/yii2-fontawesome)

Code Status
-----------

[](#code-status)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4ac4d44552fea98006937b3e391344e067b10e2af0e81f9ba257a686ba54dfb4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726d726576696e2f796969322d666f6e74617765736f6d652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rmrevin/yii2-fontawesome/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/11e0cabc2f2a1b887d9dc39323f8e43e192228b8f12f3f76f911f9cf360b3508/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726d726576696e2f796969322d666f6e74617765736f6d652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rmrevin/yii2-fontawesome/?branch=master)[![Travis CI Build Status](https://camo.githubusercontent.com/3a451c32e98fee2b4c4ff0d98f42c0d51d53bc1cac6e071eb3f9e548e6236811/68747470733a2f2f7472617669732d63692e6f72672f726d726576696e2f796969322d666f6e74617765736f6d652e737667)](https://travis-ci.org/rmrevin/yii2-fontawesome)[![Dependency Status](https://camo.githubusercontent.com/5d4592a0e2cadbfa88b0136b01f3feb77e64418592af448757bf61d5ee8538bb/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3534313139623739396531363232396665303030303064612f62616467652e737667)](https://www.versioneye.com/user/projects/54119b799e16229fe00000da)

Support
-------

[](#support)

- [GutHub issues](https://github.com/rmrevin/yii2-fontawesome/issues)
- [Public chat](https://gitter.im/rmrevin/support)

Update to `2.17`
----------------

[](#update-to-217)

Be careful in version 2.17 deprecated methods were removed. More in the [changelog](https://github.com/rmrevin/yii2-fontawesome/blob/master/CHANGELOG.md).

Installation
------------

[](#installation)

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

Either run

```
composer require "rmrevin/yii2-fontawesome:~2.17"
```

or add

```
"rmrevin/yii2-fontawesome": "~2.17",

```

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

Usage
-----

[](#usage)

In view

```
rmrevin\yii\fontawesome\AssetBundle::register($this);
```

or as dependency in your main application asset bundle

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

	public $depends = [
		// ...
		'rmrevin\yii\fontawesome\AssetBundle'
	];
}
```

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

[](#class-reference)

Namespace: `rmrevin\yii\fontawesome`;

\###Class `FA` or `FontAwesome`

- `static FA::icon($name, $options=[])` - Creates an [`component\Icon`](#class-componenticon-icon) 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 FA::stack($name, $options=[])` - Creates an [`component\Stack`](#class-componentstack-stack) that can be used to FontAwesome html icon
    - `$options` - additional attributes for `span.fa-stack` html tag.

\###Class `component\Icon` (`$Icon`)

- `(string)$Icon` - render icon
- `$Icon->render()` - DEPRECATED! render icon
- `$Icon->tag($value)` - DEPRECATED! set another html tag for icon (default `i`)
    - `$value` - name of tag
- `$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` (`$Stack`)

- `(string)$Stack` - render icon stack
- `$Stack->render()` - DEPRECATED! render icon stack
- `$Stack->tag($value)` - DEPRECATED! set another html tag for icon stack (default `span`)
- `$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 rmrevin\yii\fontawesome\FA;

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

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

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

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

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

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

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

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

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

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

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

// unordered list icons
echo FA::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 FA::icon(FA::_COG);
echo FA::icon(FA::_DESKTOP);
echo FA::stack()
     ->on(FA::_CIRCLE_O)
     ->icon(FA::_TWITTER);
```

### Set another prefix

[](#set-another-prefix)

```
FA::$cssPrefix = 'awf';

echo FA::icon('home');
//
echo FA::icon('cog')->inverse();
//
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% 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 ~22 days

Recently: every ~36 days

Total

49

Last Release

3459d ago

Major Versions

1.2.1 → 2.0.02014-06-05

PHP version history (2 changes)2.6.1PHP &gt;=5.4.0

2.17.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c041fd08db5356ee5a458a6afe5f1de68bd2ce660dda21e9c12810fe5581fd0?d=identicon)[DevMastersBV](/maintainers/DevMastersBV)

---

Top Contributors

[![rmrevin](https://avatars.githubusercontent.com/u/803507?v=4)](https://github.com/rmrevin "rmrevin (144 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)")[![julianrutten](https://avatars.githubusercontent.com/u/1588481?v=4)](https://github.com/julianrutten "julianrutten (1 commits)")[![haqqi](https://avatars.githubusercontent.com/u/831763?v=4)](https://github.com/haqqi "haqqi (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)")[![Faryshta](https://avatars.githubusercontent.com/u/2029247?v=4)](https://github.com/Faryshta "Faryshta (1 commits)")

---

Tags

bundleyiiassetfontawesome

### Embed Badge

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

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

###  Alternatives

[rmrevin/yii2-fontawesome

Asset Bundle for Yii2 with Font Awesome

1574.2M135](/packages/rmrevin-yii2-fontawesome)

PHPackages © 2026

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