summaryrefslogtreecommitdiff
path: root/lib/smarty3/sysplugins/smarty_internal_resource_extends.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/smarty3/sysplugins/smarty_internal_resource_extends.php')
-rw-r--r--lib/smarty3/sysplugins/smarty_internal_resource_extends.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/smarty3/sysplugins/smarty_internal_resource_extends.php b/lib/smarty3/sysplugins/smarty_internal_resource_extends.php
index 4a712e5..8094693 100644
--- a/lib/smarty3/sysplugins/smarty_internal_resource_extends.php
+++ b/lib/smarty3/sysplugins/smarty_internal_resource_extends.php
@@ -37,11 +37,12 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource
$uid = '';
$sources = array();
$components = explode('|', $source->name);
+ $smarty = &$source->smarty;
$exists = true;
foreach ($components as $component) {
/* @var \Smarty_Template_Source $_s */
- $_s = Smarty_Template_Source::load(null, $source->smarty, $component);
- if ($_s->type == 'php') {
+ $_s = Smarty_Template_Source::load(null, $smarty, $component);
+ if ($_s->type === 'php') {
throw new SmartyException("Resource type {$_s->type} cannot be used with the extends resource type");
}
$sources[ $_s->uid ] = $_s;
@@ -85,11 +86,9 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource
public function getContent(Smarty_Template_Source $source)
{
if (!$source->exists) {
- throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
+ throw new SmartyException("Unable to load template '{$source->type}:{$source->name}'");
}
-
$_components = array_reverse($source->components);
-
$_content = '';
/* @var \Smarty_Template_Source $_s */
foreach ($_components as $_s) {
@@ -117,6 +116,9 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource
*
* @return bool
*/
+ /**
+ * @return bool
+ */
public function checkTimestamps()
{
return false;