protected function beforeValidate() { $model = $this->getFields(); foreach ($model as $field) { if ($field->field_type == "LIST") { $fname = $field->varname; if ($this->{$fname} && is_array($this->{$fname})) { $this->{$fname} = implode(",", $this->{$fname}); } } } return parent::beforeValidate(); }