Using Font Awesome Icons In Cbuttoncolumn

Hey

I want to use Font Awesome Icons in CButtonColumn.

I did it like explaines here. But it doesn`t work…




array(

   'class'=>'CButtonColumn',

   'template'=>'{view}{delete}',

   'buttons'=>array(

	'view'=>array(

		'label'=>'<i class="fa fa-camera-retro fa-lg"></i>',

		'imageUrl'=>false,

	),

   ),

),



Thanks for your help ;D

hey man, if you are using bootstrap, then you can simple way to create any button with icon.

eg.


$this->widget('bootstrap.widgets.TbButton', 

     array('buttonType' => 'submit', 'type' => 'primary', 'label' => 'Login', 'icon' => 'user'));

Where do I have to put it in my CGridView?

how did you configure fontawesome??

you need:


'components'=>array(

    ...

    'efontawesome' => array(

         'class' => 'ext.EFontAwesome.components.EFontAwesome',

    ),

    ...

),

and


    'preload'=>array(

        ...

        'efontawesome',

    ),

I tested your code it worked like a charm, make sure you have font-awesome.css loaded


array(

			'class'=>'CButtonColumn',

			'template'=>'{view}{delete}',

			'buttons'=>array(

				'view'=>array(

					'label'=>'<i class="fa fa-user"></i>',

					'imageUrl'=>false,

				)

			)

		)

Thanks alirz23

I forgot to load the awesome-css file :blink:

Now I got it!!