fix Определение шаблона

This commit is contained in:
origami11@yandex.ru 2022-09-30 11:46:52 +03:00
parent 95fc1b28c8
commit 282fff8276

View file

@ -247,17 +247,21 @@ class Controller_Component
$template = $component->getTemplateName($registry); $template = $component->getTemplateName($registry);
$component->viewPath = array( $component->viewPath = array(
COMPONENTS . '/' . $name . '/', // Сначало ищем локально
BASE_PATH . '/templates/' . $template . '/_components/' . $name . '/',
BASE_PATH . '/components/' . $name . '/', BASE_PATH . '/components/' . $name . '/',
// Потом в общем хранилище
CMS_PATH . '/../templates/' . $template . '/_components/' . $name . '/', CMS_PATH . '/../templates/' . $template . '/_components/' . $name . '/',
BASE_PATH . '/templates/' . $template . '/_components/' . $name . '/' COMPONENTS . '/' . $name . '/',
); );
if (defined('COMPONENTS_WEB')) { if (defined('COMPONENTS_WEB')) {
$component->webPath = array( $component->webPath = array(
COMPONENTS_WEB . '/' . $name, // Сначало локально
SITE_WWW_PATH . '/templates/' . $template . '/_components/' . $name,
SITE_WWW_PATH . '/components/' . $name, SITE_WWW_PATH . '/components/' . $name,
// Потом в общем хранилище
TEMPLATE_WEB . '/' . $template . '/_components/' . $name, TEMPLATE_WEB . '/' . $template . '/_components/' . $name,
SITE_WWW_PATH . '/templates/' . $template . '/_components/' . $name COMPONENTS_WEB . '/' . $name,
); );
$component->COMPONENTS_WEB = COMPONENTS_WEB; $component->COMPONENTS_WEB = COMPONENTS_WEB;
} else { } else {