我有这样的代码
<div class="col-sm-9">
<?php $attributes = 'class = "form-control" id = "actype"';
echo form_dropdown('actype',$actype,set_value('actype',$detail[0]>activity_type),$attributes);?>
</div>
&#13;
我的模特:
function get_actype()
{
$type_id = array('-SELECT-');
$type_name = array('-SELECT-');
for ($i = 0; $i < count($result); $i++)
{
array_push($type_id, $result[$i]->activity_type_id);
array_push($type_name, $result[$i]->activity_type_name);
}
return $actype_result = array_combine($type_id, $type_name);
}
&#13;
如何创建所需的验证下拉列表