首页 > 代码库 > $form->dropDownList

$form->dropDownList

<div class="control-group">
<?php echo $form->labelEx($model,‘project_id‘,array(‘class‘ => ‘control-label‘)); ?>
<div class="controls">
<?php
$project =Project::model()->findAll();
$list = CHtml::listData($project,‘project_id‘,‘name‘);
echo $form->dropDownList($model,‘project_id‘, $list);
?>
<?php echo $form->error($model,‘project_id‘); ?>
</div>
</div>