I want to display the selected value in the drop-down list in Yii framework. I have generated code using the Yii CRUD operation. While adding and updating it uses the same view i.e. _form.php.
<?php echo $form->labelEx($model,'prj_id'); ?>
<?php
$list = CHtml::listData(ProjectList::model()->findAll(array('order' => 'prj_name')), 'prj_id', 'prj_name');
echo $form->dropDownList($PrjList, 'prj_id', $list);
?>
<?php echo $form->error($model,'prj_id'); ?>
Suppose I have country names in my dropdown. While adding I have selected India and saved it in the database. At the time of updating it should display India as my selected country.
Thanks in advance.