我在添加Kohana 3.1中的回調過濾器時遇到了一些問題。我在添加Kohana 3.1中的過濾器時遇到了問題3.1
這裏是我的驗證:
Validation::factory($fields)
->rules('username', $this->_rules['username'])
->rule('username', 'username_available', array($this, ':field'))
->rules('email', $this->_rules['email'])
->rule('email', 'email_available', array($this, ':field'))
->rules('password', $this->_rules['password'])
->rules('password_confirm', $this->_rules['password_confirm'])
->filter('password', $this->_filters['password']);
下面是過濾器的陣列:
protected $_filters = array(
'password' => array(
'Auth::instance' => 'hash'
)
);
它曾經是這樣的:
public function filters()
{
return array(
'password' => array(
array(array(Auth::instance(), 'hash'))
)
);
}
預先感謝任何幫幫我!
什麼是問題? – biakaveron
ErrorException [致命錯誤]:調用未定義的方法Validation :: filter() – jnbdz
在這一行上: - > filter('password',$ this - > _ filters ['password']); – jnbdz