在注册表单中,使用了密码字段和确认密码字段。使用此数据后无法更新。模型
public function rules()
{
// NOTE: you should only define rules for those attributes that
return array(
array('name, password', 'required'),
array('password', 'compare', 'compareAttribute'=>'confirm_password'),
array('name', 'length', 'max'=>55),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, name', 'safe', 'on'=>'search'),
);
}
尝试从 index.php 更新用户模型
`$post= User::model()->findByPk(1); $post->name='Abcdef'; $post->password='newpassword'; $post->save();`
新数据没有更新?什么时候解决?