Hi I’m going through the blog tutorial 1.1a
on page 17 a method called safeAttributes is discussed the text tells me to modify this method (but it is not created by yiic)
Do I have to create a method called safeAttributes like this
public function safeAttributes()
{
return array('ismenu','ispublished','isvisible','iscontainer');
}
or is this line doing exactly the same thing?
array('ismenu, ispublished, isvisible, iscontainer', 'safe'),
in this yiic generated method
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('name, linktext, linkurl, description, acl', 'required'),
array('title', 'required','message'=>'Custom message for title'), // my mod
array('linkindex, acl', 'numerical', 'integerOnly'=>true),
array('name, menu, pageparent', 'length', 'max'=>50),
array('linktext', 'length', 'max'=>30),
array('linkurl', 'length', 'max'=>200),
array('description, title', 'length', 'max'=>160),
array('ismenu, ispublished, isvisible, iscontainer', 'safe'),
);
}
Is it possible the blog demo is out of date regarding this?
doodle