/** * Get options and the option key * * @param string $path * @return array */ public function parsePath($path) { $key = $path; if (preg_match('#::#', $path)) { $path = str_replace('.', '/', $path); } else { $path = \Theme::getType() . '/' . \Theme::getCurrent(); } $path = $this->themePath . '/' . $path . '/'; $options = isset(static::$options[$path]) ? static::$options[$path] : []; if (empty($options) and $this->file->isDirectory($path) and $this->file->exists($path . 'options.php')) { $options = $this->file->getRequire($path . 'options.php'); } static::$options[$path] = $options; return [$options, $key]; }
/** * Generate theme directory * * @return string */ protected function generateThemeDir($theme = "") { $themePath = $this->config->get('theme::themeDir'); $theme = empty($theme) ? $this->theme->getCurrent() : $theme; return $themePath . '/' . $this->theme->getType() . '/' . $theme . '/'; }