尝试按照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')
答案 0 :(得分:6)
使用3.1? Validate
现在为Validation
,过滤器已被删除。
查看 http://kohanaframework.org/3.1/guide/kohana/upgrading 和 http://forum.kohanaframework.org/discussion/comment/57374 。