tapvolt
(Gareth Jackson)
October 9, 2013, 2:46pm
1
I have a drop down list of status names that are all lowercase in the DB, but I would like to upper-case. Is there a simple way I can do this all in-line?
echo $form->dropDownList($model,'status',CHtml::listData(Status::model()->findAllByAttributes(array('enabled'=>true)), 'id', 'name'), array('empty'=>''));
tapvolt:
I have a drop down list of status names that are all lowercase in the DB, but I would like to upper-case. Is there a simple way I can do this all in-line?
echo $form->dropDownList($model,'status',CHtml::listData(Status::model()->findAllByAttributes(array('enabled'=>true)), 'id', 'name'), array('empty'=>''));
Hi
Try this.
array_map(“ucfirst”, CHtml::listData(Status::model()->findAllByAttributes(array(‘enabled’=>true)))
Thanks
chandran nepolean