Kohana 3 throwing a fatal error when validating
-
13-12-2020 - |
Question
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')
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow