我正在尝试为验证码添加外部验证规则,如下所示:
$extra_rules = Validation::factory($_POST)
->rule('captcha', array(Captcha::valid($_POST['captcha'])));
我认为有效的功能正在运行,但随后出现此错误:
ErrorException [ Notice ]: Undefined offset: 1 SYSPATH/classes/Kohana/Validation.php [ 376 ]
371 // Replace with bound value
372 $rule[0] = $this->_bound[$rule[0]];
373 }
374
375 // This is an array callback, the method name is the error name
376 $error_name = $rule[1];
377 $passed = call_user_func_array($rule, $params);
请帮忙。我不知道如何管理这个验证码验证