Virtual attributes in $this->attributes?

How do I make a virtual attribute appears into $this->attributes so it can be assigned in form?


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.