Kohana 3 throwing a fatal error when validating
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.
精彩评论