Kohana 3在验证时抛出致命错误

时间:2011-05-23 19:02:14

标签: php validation kohana-3 kohana-auth

尝试按照wiki上的示例进行操作:extending model Auth user class,并且在进行验证时遇到致命错误。

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')

1 个答案:

答案 0 :(得分:6)

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

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