에서 Confirm Password (규칙 비교)를 사용할 때 데이터를 업데이트 할 수 없음 등록 양식에서 암호 필드와 암호 확인 필드를 사용하십시오. 사용 후이 데이터는 업데이트 할 수 없습니다. 모델YII 모델
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'),
);
}
는
`$post= User::model()->findByPk(1); $post->name='Abcdef'; $post->password='newpassword'; $post->save();`
새로운 데이터가 업데이트되지 index.php를에서 사용자 모델을 업데이트하려고? 그것이 풀릴 때?