title: Yii dropdown different display values
body: <p>What is the best way to display 1 as "Yes" and 0 as "No" on View and listing pages which use Yii generated CRUD code (<code>zii.widgets.CDetailView</code>).</p>
  
  <p>I'm writing down below simply which worked for me if it helps others (Thanks to Pentium 10 for the hint):</p>
  
  <h2>BEFORE: (Generated by Gii)</h2>
  
  <pre><code>$this-&gt;widget('zii.widgets.CDetailView', array(
      'data'=&gt;$model,
      'attributes'=&gt;array(
          's_no',
          'gateway',
          'code',
          'isvlid',
      ),
  ));
  </code></pre>
  
  <h2>AFTER: (Manually edited slightly)</h2>
  
  <pre><code>    $this-&gt;widget('zii.widgets.CDetailView', array(
      'data'=&gt;$model,
      'attributes'=&gt;array(
          's_no',
          'gateway',
          'code',
  
      // Is Valid (Now i control the Label and Display Value)
          array(
        'label'=&gt;'Active',
        'value'=&gt;$model-&gt;isvalid ? "Yes" : "No",
      ),
      ),
  ));
  </code></pre>