Kohana 3 验证时抛出致命错误
尝试按照维基上的示例进行操作: extending model Auth 用户类,当它进行验证时我遇到了致命错误。
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')
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')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用3.1?
Validate
现在是Validation
并且过滤器已被删除。查看http://kohanaframework.org/3.1/guide/kohana/upgrading和http://forum.kohanaframework.org/discussion/comment/57374。
Using 3.1?
Validate
is nowValidation
and filters have been removed.Check out http://kohanaframework.org/3.1/guide/kohana/upgrading and http://forum.kohanaframework.org/discussion/comment/57374.