PHPackages                             codingfogey/fontawesome-bundle - 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. codingfogey/fontawesome-bundle

Abandoned → [braincrafted/bootstrap-bundle](/?search=braincrafted%2Fbootstrap-bundle)Symfony-bundle[Utility &amp; Helpers](/categories/utility)

codingfogey/fontawesome-bundle
==============================

Easy integration of Font Awesome into Symfony2 projects.

v0.3.0(12y ago)22.1k3MITPHPPHP &gt;=5.3.3

Since Nov 22Pushed 10y ago1 watchersCompare

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

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

**As [braincrafted/bootstrap-bundle](https://github.com/braincrafted/bootstrap-bundle.git) now supports Font Awesome directly, this bundle is no longer maintained.**

CodingfogeyFontAwesomeBundle
============================

[](#codingfogeyfontawesomebundle)

[![License](https://camo.githubusercontent.com/92df86bd99435f410c1805107a5db9ba1d9c430e274cf1b934085e461e6d7bf4/68747470733a2f2f706f7365722e707567782e6f72672f636f64696e67666f6765792f666f6e74617765736f6d652d62756e646c652f6c6963656e73652e706e67)](https://packagist.org/packages/codingfogey/fontawesome-bundle)[![Total Downloads](https://camo.githubusercontent.com/086576c45aea8c8c77101c50f291ed75510bb2556087897ae8fa93e00149d969/68747470733a2f2f706f7365722e707567782e6f72672f636f64696e67666f6765792f666f6e74617765736f6d652d62756e646c652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/codingfogey/fontawesome-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/60bd648fdf68dbf894d13f9cf4a8bd6745885dea56eaefd7f61aa37b12b69b62/68747470733a2f2f706f7365722e707567782e6f72672f636f64696e67666f6765792f666f6e74617765736f6d652d62756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/codingfogey/fontawesome-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/98cc7bc775a83e74c30adc8e4c6785475cf94370fc7bcad4a7be8076152d5a20/68747470733a2f2f706f7365722e707567782e6f72672f636f64696e67666f6765792f666f6e74617765736f6d652d62756e646c652f762f756e737461626c652e706e67)](https://packagist.org/packages/codingfogey/fontawesome-bundle)[![Build Status](https://camo.githubusercontent.com/126b79663d0a00f1bf2f1b0c9e1d11b717a9415d3a07710d16650e9d0f101edb/68747470733a2f2f7472617669732d63692e6f72672f636f64696e67666f6765792f666f6e74617765736f6d652d62756e646c652e706e67)](https://travis-ci.org/codingfogey/fontawesome-bundle)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/be7ec83ffcf0e139c50c175dd5b065802a91e0bd5bd04860ae51b6fa8cd28002/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f64696e67666f6765792f666f6e74617765736f6d652d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f733d64646633353037616238303535343734623436646235316139326537613438366139346139333161)](https://scrutinizer-ci.com/g/codingfogey/fontawesome-bundle/)[![SensioLabsInsight](https://camo.githubusercontent.com/cf461a9da5b7ff4da13be4bf7c9094175fae4c361c5e5c448e271cbbba1d4e55/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37623861393865612d653865382d343963302d613562302d3765653337383030396230372f6d696e692e706e67)](https://insight.sensiolabs.com/projects/7b8a98ea-e8e8-49c0-a5b0-7ee378009b07)[![Stories in Ready](https://camo.githubusercontent.com/ffd4ac6b1b7715c05ab962fd3d328ef87ba918e48f961c58c4835a0f8447851a/68747470733a2f2f62616467652e776166666c652e696f2f636f64696e67666f6765792f666f6e74617765736f6d652d62756e646c652e706e673f6c6162656c3d7265616479267469746c653d5265616479)](https://waffle.io/codingfogey/fontawesome-bundle)

[![knpbundles.com](https://camo.githubusercontent.com/2b747139a621f3ce1f056de205d553a6b881e00471b6e7c6288cbfa399b9b1d8/687474703a2f2f6b6e7062756e646c65732e636f6d2f636f64696e67666f6765792f666f6e74617765736f6d652d62756e646c652f62616467652d73686f7274)](http://knpbundles.com/codingfogey/fontawesome-bundle)

About
-----

[](#about)

This Bundle makes it easy to integrate [Font Awesome](http://fortawesome.github.io/Font-Awesome/) into your [Symfony2](http://symfony.com/) projects.

Prerequisites
-------------

[](#prerequisites)

- Font Awesome installed somewhere in your project. It is not contained in this bundle. You can use [Composer](http://getcomposer.org), [Bower](http://bower.io) or any other way to install it.

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

[](#installation)

1. Add `codingfogey/fontawesome-bundle` to your `composer.json`:

    ```
     {
         ...
         "require": {
             ...
             "codingfogey/fontawesome-bundle": "dev-master",
             "fortawesome/font-awesome": "v4.0.3"
         }
         ...
     }

    ```
2. Add `CodingfogeyFontAwesomeBundle` to your `AppKernel.php`:

    ```
     ...
     public function registerBundles()
     {
         $bundles = array(
             ...
             new Codingfogey\Bundle\FontAwesomeBundle\CodingfogeyFontAwesomeBundle()
         );
         ...
     }
     ...

    ```
3. Update your dependencies: `composer update`.

NOTICE Installing Font Awesome via composer is optional but makes this bundle work out of the box. So I recommend this way.

Configuration
-------------

[](#configuration)

If you did not install Font Awesome via composer you have to configure the path to your installation:

```
codingfogey_font_awesome:
    assets_dir: %kernel.root_dir%/../vendor/fortawesome/font-awesome

```

Customization
-------------

[](#customization)

If you want to customize Font Awesome you have to put a customized variables file somewhere in your project and configure the path. You also have to set the output path.

```
codingfogey_font_awesome:
    filter: less
    customize:
        variables_file:         %kernel.root_dir%/Resources/fontawesome/variables.less
        font_awesome_output:    %kernel.root_dir%/Resources/less/fontawesome.less

```

If you want to use the `lessphp` or `sass` Assetic filter you have to set the `filter` variable accordingly.

There is a command to generate a customized output file to incorporate your customized variables file:

```
app/console codingfogey:fontawesome:generate

```

Usage
-----

[](#usage)

### Installation of font files

[](#installation-of-font-files)

The bundle provides a command to install the font files to the `web/fonts` directory:

```
app/console codingfogey:fontawesome:install

```

There is also a `ScriptHandler` for conveniently doing this automatically on each `composer install` or `composer update`:

```
...
"scripts": {
    "post-install-cmd": [
        ...
        "Codingfogey\\Bundle\\FontAwesomeBundle\\Composer\\ScriptHandler::install"
    ],
    "post-update-cmd": [
        ...
        "Codingfogey\\Bundle\\FontAwesomeBundle\\Composer\\ScriptHandler::install"
    ]
},
...

```

To include the Font Awesome css just include `@fontawesome_css` in your base template.

```

        {% block title %}Welcome!{% endblock %}
        {% block stylesheets %}
            {% stylesheets
                '@fontawesome_css'
            %}

            {% endstylesheets %}
        {% endblock %}

```

### Adding icons

[](#adding-icons)

You can add icons as described [here](http://fortawesome.github.io/Font-Awesome/examples/).

You can also use the handy [Twig](http://twig.sensiolabs.org/) function.

NOTICE: This function does not work if you changed the `@fa-css-prefix` variable.

#### Simple icons

[](#simple-icons)

To insert a simple icon add `{{ fa_icon( icon name|options ) }}` into your template.

The parameter can be a `string` containing only the icon name without `fa-` prefix or `JSON` for more customization. The complete set of options is as follows:

```
{
    icon:           name of the icon without 'fa-' prefix
    scale:          [lg|2x|3x|4x|5x|stack-1x|stack-2x],
    fixed-width:    [true|false],
    list-icon:      [true|false],
    border:         [true|false],
    pull:           [left|right],
    spin:           [true|false],
    rotate:         [90|180|270],
    flip:           [horizontal|vertical],
    inverse:        [true|false]
}

```

#### Stacked icons

[](#stacked-icons)

To insert stacked icons add `{{ fa_icon( options, options [, container] ) }}`into your template. The first parameter is for the foreground icon, the second is for the background icon. These have to be `JSON` because you have to provide at least two parameters for each icon. The name of the icon and the scale.

The last parameter is optional and can contain options for the container element. The complete set of container options is as follows:

```
{
    type:           html element type for the container (default: span)
    scale:          [lg|2x|3x|4x|5x]
}

```

TODO
----

[](#todo)

Look [here](../../issues?milestone=&state=open).

License
-------

[](#license)

- This bundle is licensed under the [MIT License](http://opensource.org/licenses/MIT).
- For Font Awesome you can find licensing information [here](http://fortawesome.github.io/Font-Awesome/license/).

Acknowledgment
--------------

[](#acknowledgment)

- This bundle is mainly inspired by [braincrafted/bootstrap-bundle](https://github.com/braincrafted/bootstrap-bundle.git) and most of the code is taken from there.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.2% 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 ~21 days

Total

4

Last Release

4493d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ec3b3dc0448697508e9ef8482fa37951697294d009a7d51e222ba37796202a0?d=identicon)[codingfogey](/maintainers/codingfogey)

---

Top Contributors

[![codingfogey](https://avatars.githubusercontent.com/u/1442498?v=4)](https://github.com/codingfogey "codingfogey (121 commits)")[![waffle-iron](https://avatars.githubusercontent.com/u/6912981?v=4)](https://github.com/waffle-iron "waffle-iron (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codingfogey-fontawesome-bundle/health.svg)

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

###  Alternatives

[ezsystems/symfony-tools

eZ Systems Symfony Tools

19306.9k2](/packages/ezsystems-symfony-tools)

PHPackages © 2026

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