0
我剛剛瞭解到CakePHP,我希望用戶在編輯自己的信息時輸入舊密碼。從CakePHP中的Model獲取用戶信息
在我的模型user.php的
'password_old' => array(
'match_old_password' => array(
'rule' => 'matchOldPassword',
'message' => 'Wrong password'
),
'minlength' => array(
'rule' => array('minLength', '8'),
'message' => 'Minimum 8 characters long'
)
)
我創建了一個功能matchOldPassword
public function matchOldPassword(){
if($this->data['User']['password_old']==$current_password){
return true;
}
return false;
}
我的問題是,我怎麼可以在模型獲取當前用戶的密碼的價值?我使用CakePHP 2.1。
謝謝,它的工作原理 – hsenhly 2012-07-24 02:01:46