同样是listData 为什么写成下面这样就多出一行<optgroup label="0">?
<td><?php echo $form->dropDownList($model,'bumen_bianhao',
array(CHtml::listData(Bumen::model()->findAll(),'bumen_bianhao','bumen' ))); ?>
生成的html
<td><select name="Hetong[bumen_bianhao]" id="Hetong_bumen_bianhao">
<optgroup label="0">
<option value="1">部门1</option>
<option value="2">部门2</option>
<option value="3">部门3</option>
</optgroup>
</select>
</td>
Page 1 of 1
同样是Listdata 为什么写成下面这样就多出一行 同样是listData 为什么写成下面这样就多出一行
Share this topic:
Page 1 of 1

Help













