fix Путь по умолчанию

This commit is contained in:
origami11@yandex.ru 2022-10-03 17:26:18 +03:00
parent fdc13fd6be
commit b60398acd7

View file

@ -133,6 +133,10 @@ class Controller_Component
return $tpl; return $tpl;
} }
function _getDefaultPath() {
return $this->viewPath[count($this->viewPath) - 1];
}
public function getTemplatePath($name) { public function getTemplatePath($name) {
$registry/*: Settings*/ = $this->registry; $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() 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() { 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)) { if (file_exists($filename)) {
$settings = json_decode(File::getContents($filename), true); $settings = json_decode(File::getContents($filename), true);
return $settings; return $settings;