I Want To Show Mulitiselect Value In Dropdownlist

Hi Every one Thanks in advance :rolleyes:

i can able to save mulitiselect values to Db

but how to show in front screen multiselected values in dropdownlist

please any one help me

 <?php echo $form->dropDownList($model,'AllocationDepartment',CHtml::listData($Dept,'Department_Code','Department'),array('multiple'=>'true','prompt'=>'select ','selected'=>'selected'));

How you store selected values in database?

I found it working for me by below way:

let consider dropdown in view

$days = array(









if(isset($model->id) && !empty($model->id))


&#036;model-&gt;working_days = explode('-', &#036;model-&gt;working_days);


echo $form->dropDownList($model, ‘working_days’, $days, array(‘multiple’=>true,‘selected’=>‘selected’));

add beforeSave method in model class

public function beforeSave() {

    // converting array to string



        &#036;this-&gt;working_days = implode(&quot;-&quot;, &#036;this-&gt;working_days);


    return parent::beforeSave();