예제 #1
0
 public static function getConfigChildHtml($configKey)
 {
     $config = [];
     # get config from module param
     if ($module = Yii::$app->controller->module) {
         $module_config = CModule::param("block");
         if (isset($module_config[$configKey])) {
             $config = $module_config[$configKey];
         }
     }
     # if module config param is empty or not exist,
     # get config from application
     if (empty($config)) {
         $app_config = CConfig::param("block");
         if (isset($app_config[$configKey])) {
             $config = $app_config[$configKey];
         }
     }
     if (!isset($config['view']) || empty($config['view'])) {
         throw new InvalidConfigException('view and class must exist in array config!');
     } else {
         return self::getChildHtml($config);
     }
 }