Display Drop Down List In View Values From Database


 $account = Account::model()->findAll();

Above line get id,name values from account table and store it as array in $account


$acclist = CHtml::listData($account, 'id', 'account');

Above line list values


  	echo $form->dropDownList($model, 'accid',$acclist, array('prompt'=>'Select Account'));

finally above line display dropdown list

[color="#006400"]/* Moved from "General Discussion for Yii 1.1.x" to "Tips, Snippets and Tutorials" */[/color]