validate() public method

Validates the input to see if it matches the generated code.
public validate ( string $input, boolean $caseSensitive ) : boolean
$input string user input
$caseSensitive boolean whether the comparison should be case-sensitive
return boolean whether the input is valid
Example #1
0
 public function validate($input, $caseSensitive)
 {
     // Skip validation on AJAX requests, as it expires the captcha.
     if (Yii::$app->request->isAjax) {
         return true;
     }
     return parent::validate($input, $caseSensitive);
 }