尝试在此处遵循 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')