How do I make a virtual attribute appears into $this->attributes so it can be assigned in form?
Thanks
How do I make a virtual attribute appears into $this->attributes so it can be assigned in form?
Thanks
You need to mark it as safe in the validation rules:
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('description', 'safe', 'on' => 'edit, post'),
);
}
Where "edit" and "post" are two different scenarios.