mirror of
https://github.com/smarty-php/smarty.git
synced 2026-04-29 02:03:31 +02:00
- 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:
@@ -24,13 +24,14 @@ class Smarty_Config_Source extends Smarty_Template_Source {
|
||||
/**
|
||||
* create Config Object container
|
||||
*
|
||||
* @param Smarty_Resource $handler Resource Handler this source object communicates with
|
||||
* @param Smarty $smarty Smarty instance this source object belongs to
|
||||
* @param string $resource full config_resource
|
||||
* @param string $type type of resource
|
||||
* @param string $name resource name
|
||||
* @param Smarty_Resource $handler Resource Handler this source object communicates with
|
||||
* @param Smarty $smarty Smarty instance this source object belongs to
|
||||
* @param string $resource full config_resource
|
||||
* @param string $type type of resource
|
||||
* @param string $name resource name
|
||||
* @param string $unique_resource unqiue resource name
|
||||
*/
|
||||
public function __construct(Smarty_Resource $handler, Smarty $smarty, $resource, $type, $name)
|
||||
public function __construct(Smarty_Resource $handler, Smarty $smarty, $resource, $type, $name, $unique_resource)
|
||||
{
|
||||
$this->handler = $handler; // Note: prone to circular references
|
||||
|
||||
@@ -43,22 +44,9 @@ class Smarty_Config_Source extends Smarty_Template_Source {
|
||||
$this->resource = $resource;
|
||||
$this->type = $type;
|
||||
$this->name = $name;
|
||||
$this->unique_resource = $unique_resource;
|
||||
}
|
||||
|
||||
/**
|
||||
* get a Compiled Object of this source
|
||||
*
|
||||
* @param Smarty_Internal_Template $_template template objet
|
||||
* @return Smarty_Template_Compiled compiled object
|
||||
*
|
||||
public function getCompiled(Smarty_Internal_Template $_template)
|
||||
{
|
||||
$compiled = new Smarty_Template_Compiled($this);
|
||||
$this->handler->populateCompiledFilepath($compiled, $_template);
|
||||
return $compiled;
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* <<magic>> Generic setter.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user