Browse Source

Better validation rules validity check

tags/2.0.0-beta
Alexander Makarov 12 years ago
parent
commit
7b73fdff5c
  1. 2
      framework/base/Model.php

2
framework/base/Model.php

@ -329,7 +329,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess
foreach ($this->rules() as $rule) {
if ($rule instanceof Validator) {
$validators->add($rule);
} elseif (isset($rule[0], $rule[1])) { // attributes, validator type
} elseif (is_array($rule) && isset($rule[0], $rule[1])) { // attributes, validator type
$validator = Validator::createValidator($rule[1], $this, $rule[0], array_slice($rule, 2));
$validators->add($validator);
} else {

Loading…
Cancel
Save