Just a small component I've made as an exercise and for fun which make available FontAwesome icons to Yii and don't collide with Bootstrap's Glyphicons.
Requirements ¶
Created and Tested with Yii 1.1.12.
Usage ¶
Extract the zip contents to a folder. Example: ext.EFontAwesome
Add the following code to config/main.php
...
'preload' => array(
...
'efontawesome',
...
),
...
// application components
'components' => array(
'efontawesome' => array(
'class' => 'ext.EFontAwesome.components.EFontAwesome',
),
),
...
How to use it:
Example taken from FontAwesome site:
icon-camera-retroNote:
The classes defined by FontAwesome are like: "icon-xxx". To use it, you must reference the icons as "icon-fa-xxx"
Excellent work!!!
Finally, many icons in bootstrap
Thanks
Please let me know if it works Ok.
Hi
Working very well
How to use it with booster-yii or yii-bootstrap extension?
Hi Guys,
Its very simple:
Instead of using class="icon-xxx"
You must use class="icon-fa-xxx"
By: EFontAwesome
Thank you FARAZFRANK!
For being a supporter!
Font Awesome Update
Thanks for this awesome extension.
I just updated the assets so i can use the newest version of Font Awesome. There is nice new stuff with it. Maybe you should update the assets too :D
Greetings
Font Awesome Update
Thank you very much.
I'll update ASAP.
icon-large etc
Only the default size works for me, icon-fa-envelope for example but not icon-fa-envelope icon-large or icon-2x and so on. Would like those to.
@sampa
Try icon-fa-large, ...
Works for me.
ofcourse...
Im stupid haha icon-fa-large etc works just fine:)
icon-fa-2x and etc
Hello, don't work resize classes, and classes like .icon-fa-2x don't determined in css file. mb i do something wrong?
Bug in source code
You have a small bug in EFontAwesome.php. You're using
if(Yii::app() instanceof CConsoleApplication) return;
This is immediate function exit, so in case of console application, your component won't call
parent::init();
, which isn't the best idea, after all.You may use for example:
if(!Yii::app() instanceof CConsoleApplication) Yii::app()->getClientScript()->registerCssFile($this->getAssetsUrl().'/css/font-awesome.css'); parent::init();
or anything similar.
one thing
first
good work!
second
the light bulb doesn't appear. Are you using the third version? can you update it?
Working with YiiBootstrap
This is my code: I cannot make large icons work.
<?php $this->widget('bootstrap.widgets.TbMenu', array( 'type'=>'list', 'items'=>array( array('label'=>'Person 1', 'icon'=>'user'), // This is from YiiBootstrap array('label'=>'(+54 9) 343 4581266', 'icon'=>'icon-fa-large-phone'), ... ), )); ?>
Thank you for your work!
Update FontAwesome version
For those who want a newer version of FontAwesome;
And use the icons as described in the examples.
Update FontAwesome version
I followed Amos's directions in #15760. Worked great once I realized I had to refer to the icons for example via 'fa fa-search', not 'icon-fa-search'. Did a global search on 'icon-fa' to 'fa fa' and they all showed up again.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.