Пример #1
0
 public function notifyRule(Rule $rule)
 {
     if (is_string($rule->operation) && strcasecmp($rule->operation, ':float') === 0) {
         $this->addFilter(callback(__CLASS__, 'filterFloat'));
     }
     parent::notifyRule($rule);
 }
Пример #2
0
 public function notifyRule(Rule $rule)
 {
     if (is_string($rule->operation) && !$rule->isNegative) {
         if (strcasecmp($rule->operation, ':float') === 0) {
             $this->addFilter(callback(__CLASS__, 'filterFloat'));
         } elseif (strcasecmp($rule->operation, ':length') === 0) {
             $this->control->maxlength = is_array($rule->arg) ? $rule->arg[1] : $rule->arg;
         } elseif (strcasecmp($rule->operation, ':maxLength') === 0) {
             $this->control->maxlength = $rule->arg;
         }
     }
     parent::notifyRule($rule);
 }