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); }
public function setConfig(Config $config) { $this->config = $config; $this->config->set('ModuleManager', $this); }
public function setArray($array) { return $this->config->set($array); }