我想将$ cluster1值添加到CHtml :: activeDropDownList
$cluster_name_models = new ClusterForm();
$records = $cluster_name_models->get_list('grade');
$cluster_details=$records['0']['grade'];
$cluster1=explode(';',$cluster_details);
$cluster1=Array ( [0] => JMC [1] => MMC [2] => SMC );
答案 0 :(得分:0)
假设成绩是相关模型属性的名称
$cluster_name_models = new ClusterForm();
$records = $cluster_name_models->get_list('grade');
$cluster_details=$records['0']['grade'];
$cluster1=explode(';',$cluster_details);
echo CHtml::activeDropDownList($model,
'grade',
$cluster1,
array('empty'=>'Select Option'));