title: Yii Php : Hiding or showing column based on data value
body: <p>I'm developing in <strong>Yii</strong> and im currently using Yii <strong>twitter bootstrap</strong> used to display some columns in a <strong>GridView</strong>:</p>
  
  <p>Suppose I have this :</p>
  
  <pre><code>$this-&gt;widget('bootstrap.widgets.TbGridView', array(
      'id'=&gt;'gridview',
      'dataProvider'=&gt;new CArrayDataProvider($model),
      'template'=&gt;"{items}",
      'type'=&gt;'bordered',
      'columns'=&gt;array(
                  array(
                      'header' =&gt; 'Entries',
                      'value' =&gt; '$data-&gt;entry_name'
                  ),
                  array(
                      'name' =&gt; 'value',
                      'header' =&gt; 'Value',
                      'value'=&gt;function($data){
                          //if $data-&gt;value is zero then hide the "Value" column
                          if($data-&gt;value == 0){
                          //do something to hide the column here
                          }
                          //otherwise return a label to display the value inside
                          return CHtml::label($data-&gt;value,FALSE,array('id'=&gt;'label'));
                      },
                      'type'=&gt;'raw',
                  ),
                )
        )
  );
  </code></pre>
  
  <p>I could hide the entire column by using:</p>
  
  <pre><code>'headerHtmlOptions'=&gt;array('style'=&gt;'display:none'), 
  'htmlOptions'=&gt;array('style'=&gt;'display:none'),
  </code></pre>
  
  <p>But this is after i passed the columns parameter to the widget. I want to hide the "Value" column when its value is zero. How do i do <strong>hide or show</strong> the entire column <strong>based on its value?</strong> Thank You very much!</p>