Hello world.
I have a problem with array data and models.
Is there a rule in the models, which serialize arrays before saving in the database and vice versa on select()?
i tried like this:
public function rules()
{
return array(
array('food, annotation, date', 'required'),
array('food', 'type', 'array'),
array('annotation', 'length', 'max'=>10000),
array('time_end', 'safe'),
// The following rule is used by search().
array('id, annotation, date, time_end', 'safe', 'on'=>'search'),
);
}
but yii didn’t like this way
Property 'CTypeValidator.0' is not defined.
i sense yii must have the default way.
Please help me.