1

尝试在此处遵循 wiki 上的示例:扩展模型身份验证用户类,并且在进行验证时遇到了致命错误。

ErrorException [ Fatal Error ]: Class 'Validate' not found

有任何想法吗?这是它失败的一段代码:

class Model_User extends Model_Auth_User
  {
    public function validate_create(& $array) 
    {
        // Initialise the validation library and setup some rules       
        $array = Validate::factory($array)
                        ->rules('password', $this->_rules['password'])
                        ->rules('username', $this->_rules['username'])
                        ->rules('email', $this->_rules['email'])
                        ->rules('password_confirm', $this->_rules['password_confirm'])
                        ->filter('username', 'trim')
4

1 回答 1

6

使用 3.1? Validate现在是Validation,过滤器已被删除。

查看http://kohanaframework.org/3.1/guide/kohana/upgradinghttp://forum.kohanaframework.org/discussion/comment/57374

于 2011-05-23T19:06:19.213 回答