whuhacker
(Zx0071)
1
I want to display icons in a CGridView column, the following code works fine
'columns'=>array(
...
array(
'header'=>'Action',
'type'=>'html',
'value'=>'CHtml::tag("a",array("class"=>"ico-small ico-edit edit_service_trigger", "href"=>"#"))',
),
)
However, I have 2 icons to display, the following code will not work
'columns'=>array(
...
array(
'header'=>'Action',
'type'=>'html',
'value'=>'CHtml::tag("a",array("class"=>"ico-small ico-edit edit_service_trigger", "href"=>"#")); CHtml::tag("a",array("class"=>"ico-small ico-delete delete_service_trigger", "href"=>"#"))',
),
)
Any suggestions?
macinville
(Macinville)
2
Try this:
$actionIcons = CHtml::tag("a",array("class"=>"ico-small ico-edit edit_service_trigger", "href"=>"#")). CHtml::tag("a",array("class"=>"ico-small ico-delete delete_service_trigger", "href"=>"#"));
'columns'=>array(
...
array(
'header'=>'Action',
'type'=>'html',
'value'=>$actionIcons,
),
)
whuhacker
(Zx0071)
3
Thank you, but not work. No icon displayed, since no html tag generated.
mdomba
(Maurizio Domba Cerin)
4
whuhacker your code in the first post is good… you just need to change the ; with a dot (string concatenation) and it will work…