fix Определение шаблона
This commit is contained in:
parent
282fff8276
commit
fdc13fd6be
1 changed files with 5 additions and 3 deletions
|
|
@ -98,7 +98,8 @@ class Controller_Component
|
|||
$selected = null;
|
||||
foreach ($this->viewPath as $index => $viewPath) {
|
||||
// Загружать шаблон по умолчанию если не найден текущий
|
||||
if(is_dir(Path::join($this->viewPath[$index], 'templates', $template))) {
|
||||
$dir = Path::join($this->viewPath[$index], 'templates', $template);
|
||||
if(is_dir($dir)) {
|
||||
$tpl = new PHPTAL(Path::join($this->viewPath[$index], 'templates', $template, $name));
|
||||
$tpl->setPhpCodeDestination(PHPTAL_PHP_CODE_DESTINATION);
|
||||
$selected = $index;
|
||||
|
|
@ -107,10 +108,11 @@ class Controller_Component
|
|||
}
|
||||
|
||||
if ($selected === null) {
|
||||
$tpl = new PHPTAL(Path::join($this->viewPath[0], 'templates', 'modern', $name));
|
||||
// Последний вариант viewPath, путь к папке компонента
|
||||
$selected = count($this->viewPath) - 1;
|
||||
$tpl = new PHPTAL(Path::join($this->viewPath[$selected], 'templates', 'modern', $name));
|
||||
$tpl->setPhpCodeDestination(PHPTAL_PHP_CODE_DESTINATION);
|
||||
$template = 'modern';
|
||||
$selected = 0;
|
||||
}
|
||||
|
||||
$tpl->stripComments(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue