Commit c146d6c5 by Qiang Xue

allow global configuration of classes.

parent 486ab3ff
...@@ -371,6 +371,10 @@ class YiiBase ...@@ -371,6 +371,10 @@ class YiiBase
$class = static::import($class, true); $class = static::import($class, true);
} }
if (isset(self::$objectConfig[ltrim($class, '\\')])) {
$config = array_merge(self::$objectConfig[ltrim($class, '\\')], $config);
}
if (($n = func_num_args()) > 1) { if (($n = func_num_args()) > 1) {
/** @var $reflection \ReflectionClass */ /** @var $reflection \ReflectionClass */
if (isset($reflections[$class])) { if (isset($reflections[$class])) {
...@@ -531,6 +535,6 @@ class YiiBase ...@@ -531,6 +535,6 @@ class YiiBase
*/ */
public static function t($message, $params = array(), $language = null) public static function t($message, $params = array(), $language = null)
{ {
return Yii::$app->getI18N()->translate($message, $params, $language); return self::$app->getI18N()->translate($message, $params, $language);
} }
} }
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