diff --git a/src/Controller/Component.php b/src/Controller/Component.php index 1f1e18e..a528190 100644 --- a/src/Controller/Component.php +++ b/src/Controller/Component.php @@ -133,6 +133,10 @@ class Controller_Component return $tpl; } + function _getDefaultPath() { + return $this->viewPath[count($this->viewPath) - 1]; + } + public function getTemplatePath($name) { $registry/*: Settings*/ = $this->registry; // Брать настройки из куков если есть @@ -143,12 +147,12 @@ class Controller_Component } } - return Path::join($this->viewPath[0], 'templates', 'modern', $name); + return Path::join($this->viewPath[count($this->viewPath) - 1], 'templates', 'modern', $name); } public function getTemplateWebPath() { - return Path::join($this->webPath[0], 'templates', 'modern'); + return Path::join($this->webPath[count($this->webPath) - 1], 'templates', 'modern'); } /** @@ -181,7 +185,7 @@ class Controller_Component } function getInfo() { - $filename = Path::join($this->viewPath[0], 'install.json'); + $filename = Path::join($this->viewPath[count($this->viewPath) - 1], 'install.json'); if (file_exists($filename)) { $settings = json_decode(File::getContents($filename), true); return $settings;