예제 #1
0
파일: Module.php 프로젝트: dw250100785/Octo
 public function init()
 {
     $base = $this->getPath();
     $templatePath = $base . 'Template/';
     $adminTemplatePath = $base . 'Admin/Template/';
     $octoConfig = $this->config->get('Octo', []);
     if (is_dir($templatePath)) {
         $octoConfig['paths']['templates'][$this->getName()] = $templatePath;
     }
     if (is_dir($adminTemplatePath)) {
         $octoConfig['paths']['admin_templates'][$this->getName()] = $adminTemplatePath;
     }
     $octoConfig['paths']['modules'][$this->getName()] = $base;
     $octoConfig['paths']['namespaces'][$this->namespace . '\\' . $this->getName()] = $base;
     if (!isset($octoConfig['namespaces']['blocks'])) {
         $octoConfig['namespaces']['blocks'] = [];
     }
     $blocks = $this->getBlocks($this->namespace);
     $octoConfig['namespaces']['blocks'] = array_merge($octoConfig['namespaces']['blocks'], $blocks);
     $app = $this->config->get('app', []);
     $app['namespaces'] = array_merge($app['namespaces'], $this->getModels($this->namespace));
     $this->config->set('app', $app);
     $this->config->set('Octo', $octoConfig);
 }
예제 #2
0
 public function setConfig(Config $config)
 {
     $this->config = $config;
     $this->config->set('ModuleManager', $this);
 }
예제 #3
0
 public function setArray($array)
 {
     return $this->config->set($array);
 }