title: How to give attribute values to each option in Yii dropDownList?
body: <p>I have a question related to Yii DropDownList. How can we give some attribute values to each option. For Example I need to build a dropdownlist looks like below.</p>
  
  <pre><code>&lt;select&gt;
      &lt;option value="a" myAttribute="xyz"&gt;Calendar&lt;/option&gt;
      &lt;option value="n" myAttribute="PQR"&gt;Shopping Cart&lt;/option&gt;
      &lt;option value="c" myAttribute="ABC"&gt;CD&lt;/option&gt;
      &lt;option value="d" myAttribute="HMN"&gt;Email&lt;/option&gt;   
  &lt;/select&gt;
  </code></pre>
  
  <p>values and myAttributes's value are coming from table. How can I implement this by altering the following?</p>
  
  <pre><code>&lt;?php echo $form-&gt;dropDownList($model,'media_ids',Media::getAllmedia(),array('?'=&gt;'?')); ?&gt;
  </code></pre>
  
  <p>in model Media I have function like this </p>
  
  <pre><code>public function getAllmedia() {    
          $condition = 'isActive =  "Y"';    
          $model = Media::model()-&gt;findAll(array('condition' =&gt; $condition));    
          return CHtml::listData($model, 'id', 'media_title');    
      }
  </code></pre>
  
  <p><strong>EDIT</strong>: <em>My Requirement is to show images along with each option, for that i have to give another attribute to each option which holds the image path</em></p>