Also trigger warning when template is not found

This commit is contained in:
Kijin Sung 2016-10-01 21:16:01 +09:00
parent 7e5356380f
commit 78a0e857b5

View file

@ -123,7 +123,9 @@ class TemplateHandler
// if target file does not exist exit
if(!$this->file || !file_exists($this->file))
{
return escape("Template not found: ${tpl_path}${tpl_filename}" . ($tpl_file ? " (${tpl_file})" : ''));
$error_message = "Template not found: ${tpl_path}${tpl_filename}" . ($tpl_file ? " (${tpl_file})" : '');
trigger_error($error_message, \E_USER_WARNING);
return escape($error_message);
}
// for backward compatibility
@ -184,7 +186,9 @@ class TemplateHandler
// if target file does not exist exit
if(!$this->file || !file_exists($this->file))
{
return escape("Template not found: ${tpl_path}${tpl_filename}");
$error_message = "Template not found: ${tpl_path}${tpl_filename}";
trigger_error($error_message, \E_USER_WARNING);
return escape($error_message);
}
return $this->parse();