mirror of
https://github.com/smarty-php/smarty.git
synced 2026-04-29 10:13:25 +02:00
- improvment better error message for undefined templates at {include}
This commit is contained in:
@@ -116,7 +116,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
|
||||
}
|
||||
// checks if template exists
|
||||
if (!$_template->source->exists) {
|
||||
throw new SmartyException("Unable to load template {$_template->source->type} '{$_template->source->name}'");
|
||||
if ($_template->parent instanceof Smarty_Internal_Template) {
|
||||
$parent_resource = " in '{$_template->parent->template_resource}'";
|
||||
} else {
|
||||
$parent_resource = '';
|
||||
}
|
||||
throw new SmartyException("Unable to load template {$_template->source->type} '{$_template->source->name}'{$parent_resource}");
|
||||
}
|
||||
// read from cache or render
|
||||
if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || !$_template->cached->valid) {
|
||||
|
||||
Reference in New Issue
Block a user