コード例 #1
0
ファイル: Controller.php プロジェクト: JeCat/framework
 /**
  * @example /Bean/合并Bean配置
  * @forwiki /Bean/合并Bean配置
  */
 public static function createBean(array &$arrConfig, $sNamespace = '*', $bBuildAtOnce, \org\jecat\framework\bean\BeanFactory $aBeanFactory = null)
 {
     $sClass = get_called_class();
     $aBean = new $sClass(null, null, false);
     // 将传入的 bean 配置 和 controller 提供的默认bean配置合并
     if ($arrDefaultConfig = $aBean->createBeanConfig()) {
         BeanFactory::mergeConfig($arrDefaultConfig, $arrConfig);
         $arrConfig = $arrDefaultConfig;
     }
     if ($bBuildAtOnce) {
         $aBean->buildBean($arrConfig, $sNamespace, $aBeanFactory);
     }
     return $aBean;
 }