- add concept unique_resource to combat potentially ambiguous template_resource values when custom resource handlers are used (Forum Topic 2012)

http://www.smarty.net/forums/viewtopic.php?t=2012

thereby DRYed and optimized the resource handler identification method.
This commit is contained in:
rodneyrehm
2011-10-13 13:10:06 +00:00
parent 806c51fdcf
commit 6979b4efb0
11 changed files with 216 additions and 118 deletions
@@ -59,7 +59,18 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled {
return false;
}
}
/**
* modify resource_name according to resource handlers specifications
*
* @param Smarty $smarty Smarty instance
* @param string $resource_name resource_name to make unique
* @return string unique resource name
*/
protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
{
return get_class($this) . '#' . $resource_name;
}
}
?>