how to change a model safe attributes in yii


I have a CActiveRecord model, and I need to change safe attributes list in that model. I have defined the safeAttributes method inside my model, like the following :

public function safeAttributes()


    return array(

    'name, bio',



the problem is ‘bio’ is not being considered in my safe attribute assign. I tried to dump the model safeAttributeNames attribute in my model, and what I’ve got was completely different from what safeAttributes should return.

Am I doing this in the right way ?

cheers, Firas

There’s no safeAttributes() method in Yii 1.1.

See the section "Securing Attribute Assignments" in the guide

/Tommy (not a team member)

got it,