开发者

Kohana 3 throwing a fatal error when validating

开发者 https://www.devze.com 2023-03-08 06:53 出处:网络
Trying to follow the example on the wiki here: extending model Auth user class, and I am hitting a fatal error when it goes to validate.

Trying to follow the example on the wiki here: extending model Auth user class, and I am hitting a fatal error when it goes to validate.

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

Any ideas? Here's the piece of code it fails on:

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


Using 3.1? Validate is now Validation and filters have been removed.

Check out http://kohanaframework.org/3.1/guide/kohana/upgrading and http://forum.kohanaframework.org/discussion/comment/57374.

0

精彩评论

暂无评论...
验证码 换一张
取 消