Commit 2ef7eda2 by Qiang Xue

Fixes #4611.

parent fcaddb0c
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment