Question : dropdown in crud application YII
Answered by : tough-trout-tr1wgi3s6g4b
<?php $list = CHtml::listData(Country::model()->findAll(), 'id', 'name'); ?>
<?php echo $form->dropDownList($model, 'country_id', $list, array('empty'=>'(Select a Country)')); ?>
Source : http://jmmurphy.blogspot.com/2013/05/using-yii-model-relations.html | Last Update : Wed, 30 Dec 20