public function notifyRule(Rule $rule) { if (is_string($rule->operation) && strcasecmp($rule->operation, ':range') === 0 && !$rule->isNegative && $this->control->type !== 'text') { list($this->control->min, $this->control->max) = $rule->arg; // for HTML 5 } parent::notifyRule($rule); }
public function notifyRule(Rule $rule) { if (is_string($rule->operation) && strcasecmp($rule->operation, ':length') === 0 && !$rule->isNegative) { $this->control->maxlength = is_array($rule->arg) ? $rule->arg[1] : $rule->arg; } elseif (is_string($rule->operation) && strcasecmp($rule->operation, ':maxLength') === 0 && !$rule->isNegative) { $this->control->maxlength = $rule->arg; } parent::notifyRule($rule); }