This commit is contained in:
Qiang Xue
2014-08-06 08:08:07 -04:00
parent fcaddb0c62
commit 2ef7eda249

View File

@@ -197,13 +197,8 @@ class Validator extends Component
$type = static::$builtInValidators[$type];
}
if (is_array($type)) {
foreach ($type as $name => $value) {
$params[$name] = $value;
}
$params = array_merge($type, $params);
} else {
if (!class_exists($type)) {
throw new InvalidConfigException("Unknown validator: '$type'.");
}
$params['class'] = $type;
}
}