CHtml:: listBox()
if(!empty($htmlOptions['multiple']))
{
if(substr($name,-2)!=='[]')
$name.='[]';
}
So you can try this
<?php echo $form->dropDownList($model,'clients',
CHtml::listData(client::model()->findAll(array('order'=>'id')), 'id', 'name'),
array(
>>> 'name'=>CHtml::resolveName($model, 'clients').'[]',
'empty'=>'',
'multiple'=>'multiple',
'style'=>'width:400px;',
'size'=>'10',
)
);?>
But it is better to use CHtml :: listBox ()
source
share