I would like the content of activeDropDownList to be sorted alphabetically.
Currently I am doing it like this (example: article belongs to category):
$listdata = CHtml::listData(category::model()->findAll(),'id','name');
asort($listdata);
echo $formField->activeDropDownList(
$article,
'category_id',
$listdata,
array('prompt'=>Yii::t('ks','Please Select'))
);
In my opinion this is too much code for a standard problem.
Is there a more elegant way of doing this?
Maybe the sorting functionality should be built into CHtml::listData()?
Or there could be an extra function activeDropDownListFk which takes care of it all so that we can write a one-liner in the view?