Tbgridview And Fontawsome

I have the code below and I’m trying to replace what I currently use ‘value’=> 'CHtml::image($data-> with font awesome icons. Any help on how I can accomplish that would be appreciated :unsure:

<?php $this->widget(‘bootstrap.widgets.TbGridView’,array(

‘id’ => ‘vpolicy-grid’,

‘dataProvider’ => $model->searchForPolicyIndex(),

‘filter’ => $model,

‘type’ => ‘striped condensed’,

‘selectableRows’ => 1, // you can select only 1 row!!

‘selectionChanged’ => ‘function(id){ var objectId = $.fn.yiiGridView.getSelection(id); if (isNaN(objectId) || objectId == “”){return;} location.href = "’.$this->createUrl(‘policy/view’).’&id="+$.fn.yiiGridView.getSelection(id);}’,

‘columns’=>array(

  array('name'              =&gt; 'has_open_issue',


        'header'            =&gt; 'Issues',


        'type'              =&gt; 'raw',


        'value'             =&gt; '(&#036;data-&gt;has_open_issue == &quot;N&quot; ? &quot;&lt;i class=&quot;icon-fa-check icon-2x&quot; style=&quot;color:green&quot;&gt;&lt;/i&gt;&quot; : &quot;&lt;i class=&quot;icon-fa-warning-sign icon-2x&quot; style=&quot;color:red&quot;&gt;&lt;/i&gt;&quot;, &quot;&quot;, array(&quot;width&quot;=&gt;25, &quot;height&quot;=&gt;25,))',


        'filter'            =&gt; VFFormUtil::getFilter_YesNo(),


        'headerHtmlOptions' =&gt; array('style' =&gt; 'text-align: center; width: 80px'),


        'htmlOptions'       =&gt; array('style'=&gt;'text-align: center; width: 80px'),),





  array('name'              =&gt; 'compliance',


        'type'              =&gt; 'raw',


        'value'             =&gt; 'CHtml::image(&#036;data-&gt;compliance == &quot;INSUFFICIENT&quot; ? &quot;images/policy_insufficient.png&quot; : &quot;images/policy_sufficient.png&quot;, &quot;&quot;, array(&quot;width&quot;=&gt;25, &quot;height&quot;=&gt;25,))',


        'filter'            =&gt; VFFormUtil::getFilter_Compliance(),


        'headerHtmlOptions' =&gt; array('style' =&gt; 'text-align: center; width: 80px'),


        'htmlOptions'       =&gt; array('style'=&gt;'text-align: center; width: 80px'),),





  array('name'              =&gt; 'status',


        'filter'            =&gt; VFFormUtil::getFilter_ActiveInactive(),


        'headerHtmlOptions' =&gt; array('style' =&gt; 'text-align: center; width: 80px'),


        'htmlOptions'       =&gt; array('style'=&gt; 'text-align: center; vertical-align: middle; width: 80px'),),

I tried:

‘value’ => ‘CHtml::tag($data->has_open_issue == “N” ? <i class=“icon-fa-check icon-2x” style=“color:green”></i> : <i class=“icon-fa-warning-sign icon-2x” style=“color:red”></i>, “”, array(“width”=>25, “height”=>25’,

but it didn’t work…?? I appreciate you taking the time to respond!

…and this didn’t work either

‘value’=> ‘CHtml::tag($data->has_open_issue == “N” ? “<i class=“icon-fa-check icon-2x” style=“color:green”></i>” : “<i class=“icon-fa-warning-sign icon-2x” style=“color:red”></i>”, “”, array(“width”=>25, “height”=>25))’,

what am i missing? :unsure:

So here is the answer, hopefully it will help a future newbie along the way, since non of the hot-shot masters could answer a simple question.

‘value’ => ‘($data->has_open_issue == “N”) ? “<i class=\“icon-fa-check icon-2x\”></i>” : “<i class=\“icon-fa-warning-sign icon-2x\”></i>”’,

Hi,

This may help you! CGridView add custom button

Cheers!

[b]

[/b]

If works don’t hesitate to press +