Hi,
I added date_received and contributor to the model’s rules and attributeLabels, so far it was able to read it from the view, but it won’t save changes to the two added attributes. What did I missed?
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('title, category, description, keyword','required'),
array('title', 'length', 'max'=>128),
array('keyword', 'match', 'pattern'=>'/^[\w\s,]+$/', 'message'=>'Tags can only contain word characters.'),
array('keyword', 'normalizeKeywords'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('title, date_received, category, description, keyword, create_time, update_time, contributor', 'safe', 'on'=>'search'),
);
}
public function attributeLabels()
{
return array(
'id' => 'ID',
'date_received' => 'Date Received',
'title' => 'Title',
'category' => 'Category',
'description' => 'Description',
'keyword' => 'Keyword',
'create_time' => 'Create Time',
'update_time' => 'Update Time',
'author_id' => 'Author',
'contributor' => 'Contributor',
);
}