I will to add another attribute to dropDownList.
I will a dropdown list like this with Yii dropDownList:
<select name="city" id="city">
<option value="1" test="123">one</option>
<option value="2" test="234">two</option>
<option value="3" test="345">three</option>
<option value="4" test="456">four</option>
</select>
I will add test attribute to option tags.
Default Yii dropDownList is:
<?php
echo CHtml::activeDropDownList('City', 'City', array(1 => 'one', 2 => 'two'));
?>
How I can do this?
Try :
Same thing but in Yii2