article

Saturday, March 22, 2014

Make dropdownlist in yii framework

Make dropdownlist in yii framework

Create table tbl_country

 country_name  | id
 Philippines       | 1
 USA               | 2

<div class="row">
 <?php echo $form->dropDownList($model,'country_id',
  CHtml::listData(Country::model()->findAll(), 'id', 'country_name'),
  array('empty'=>'Select Country'))?>
</div>

Related Post