//this is the code which i used in my _form where i am selcting questions in my multiselect checkbox and i actually want it like if i select 2 checkboxes at a time then that two values will get stored in my database where i use this field as varchar???
<?php $data= CHtml::listData(QuestionBank::model()->findAll(), ‘id’, ‘question’);
$this-> widget('ext.EchMultiselect.EchMultiselect', array(
'model' => $model,
'dropDownAttribute' => 'Questions',
'data' => $data,
'dropDownHtmlOptions'=> array(
'style'=>'width:378px;',
),
'options' => array(
'height'=>175,
‘minWidth’=>22,
‘height’=>25,
‘checkAllText’=>Yii::t(‘application’,‘Check all’),
‘uncheckAllText’=>Yii::t(‘application’,‘Uncheck all’),
‘noneSelectedText’=>Yii::t(‘application’,‘Select an Option’),
‘selectedText’=>Yii::t(‘application’,’# selected’),
‘selectedList’=>false,
‘show’=>’’,
‘hide’=>‘true’,
‘autoOpen’=>false,
‘multiple’=>true,
‘classes’=>’’,
‘position’=>array(),
‘header’=>true,
// set this to true, if you want to use the Filter Plugin
'filter'=>false,
),
));
?>
My controller code:-
public function actionCreate()
{
$model=new Test;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['Test']))
{
$model->attributes=$_POST['Test'];
if($model->save())
$this->redirect(array('view','id'=>$model->id));
}
$this->render('create',array(
'model'=>$model,
));
}
what code should i write in my controller?