braincrafted / bootstrap-bundle

BraincraftedBootstrapBundle integrates Bootstrap into Symfony2 by providing templates, Twig extensions, services and commands.
http://bootstrap.braincrafted.com
MIT License
399 stars 182 forks source link

Use icon helper with different icon-set #392

Closed bigfoot90 closed 9 years ago

bigfoot90 commented 9 years ago

In my project I'm using three different icon sets fa-* (fontawesome), glyphicons-* (glyphicons), md-* (material-design) for different sections: frontend and backend.

By this commit I can use the icon function like this:

{{ icon('camera') }}
{{ icon('alert', 'md') }}
{{ icon('user+fw', 'fa') }}

and the parse_icons filter like this:

{{ '.icon-heart'|parse_icons }}
{{ '.md-alert'|parse_icons }}
{{ '.fa-user+fw'|parse_icons }}

and will render to:

<i class="glyphicon glyphicon-heart"></i>
<i class="md md-alert"></i>
<i class="fa fa-user fa-fw"></i>
florianeckerstorfer commented 9 years ago

Thank you very much.

bigfoot90 commented 9 years ago

@florianeckerstorfer Thanks you for merging. When you plan to set a new tag?

florianeckerstorfer commented 9 years ago

I don't know. Just realised how long it had been since the last release. I'll try to squeeze it in this weekend.