\Smarty_Internal_Resource_Extends

Smarty Internal Plugin Resource Extends

Implements the file system as resource for Smarty which {extend}s a chain of template files templates

Summary

Methods
Properties
Constants
getContent()
populate()
populateTimestamp()
populateCompiledFilepath()
getBasename()
load()
getUniqueTemplateName()
source()
config()
$sources
$compileds
$resources
$compiler_class
$template_lexer_class
$template_parser_class
No constants found
buildUniqueResourceName()
buildFilepath()
fileExists()
parseResourceName()
$sysplugins
N/A
No private methods found
No private properties found
N/A

Properties

$sources

$sources : array

cache for Smarty_Template_Source instances

Type

array

$compileds

$compileds : array

cache for Smarty_Template_Compiled instances

Type

array

$resources

$resources : array

cache for Smarty_Resource instances

Type

array

$compiler_class

$compiler_class : string

Name of the Class to compile this resource's contents with

Type

string

$template_lexer_class

$template_lexer_class : string

Name of the Class to tokenize this resource's contents with

Type

string

$template_parser_class

$template_parser_class : string

Name of the Class to parse this resource's contents with

Type

string

$sysplugins

$sysplugins : array

resource types provided by the core

Type

array

Methods

getContent()

getContent(\Smarty_Template_Source  $source) : string

Load template's source from files into current template object

Parameters

\Smarty_Template_Source $source

source object

Throws

\SmartyException

if source cannot be loaded

Returns

string —

template source

populate()

populate(\Smarty_Template_Source  $source, \Smarty_Internal_Template  $_template = null) 

populate Source Object with meta data from Resource

Parameters

\Smarty_Template_Source $source

source object

\Smarty_Internal_Template $_template

template object

populateTimestamp()

populateTimestamp(\Smarty_Template_Source  $source) 

populate Source Object with timestamp and exists from Resource

Parameters

\Smarty_Template_Source $source

source object

populateCompiledFilepath()

populateCompiledFilepath(\Smarty_Template_Compiled  $compiled, \Smarty_Internal_Template  $_template) 

populate Compiled Object with compiled filepath

Parameters

\Smarty_Template_Compiled $compiled

compiled object

\Smarty_Internal_Template $_template

template object

getBasename()

getBasename(\Smarty_Template_Source  $source) : string

Determine basename for compiled filename

Parameters

\Smarty_Template_Source $source

source object

Returns

string —

resource's basename

load()

load(\Smarty  $smarty, string  $type) : \Smarty_Resource

Load Resource Handler

Parameters

\Smarty $smarty

smarty object

string $type

name of the resource

Returns

\Smarty_Resource

Resource Handler

getUniqueTemplateName()

getUniqueTemplateName(string  $smarty, string  $template_resource) : string

modify template_resource according to resource handlers specifications

Parameters

string $smarty

Smarty instance

string $template_resource

template_resource to extracate resource handler and name of

Returns

string —

unique resource name

source()

source(\Smarty_Internal_Template  $_template = null, \Smarty  $smarty = null, string  $template_resource = null) : \Smarty_Template_Source

initialize Source Object for given resource

Either [$_template] or [$smarty, $template_resource] must be specified

Parameters

\Smarty_Internal_Template $_template

template object

\Smarty $smarty

smarty object

string $template_resource

resource identifier

Returns

\Smarty_Template_Source

Source Object

config()

config(\Smarty_Internal_Config  $_config) : \Smarty_Config_Source

initialize Config Source Object for given resource

Parameters

\Smarty_Internal_Config $_config

config object

Returns

\Smarty_Config_Source

Source Object

buildUniqueResourceName()

buildUniqueResourceName(\Smarty  $smarty, string  $resource_name) : string

modify resource_name according to resource handlers specifications

Parameters

\Smarty $smarty

Smarty instance

string $resource_name

resource_name to make unique

Returns

string —

unique resource name

buildFilepath()

buildFilepath(\Smarty_Template_Source  $source, \Smarty_Internal_Template  $_template = null) : string

build template filepath by traversing the template_dir array

Parameters

\Smarty_Template_Source $source

source object

\Smarty_Internal_Template $_template

template object

Throws

\SmartyException

if default template handler is registered but not callable

Returns

string —

fully qualified filepath

fileExists()

fileExists(\Smarty_Template_Source  $source, string  $file) : boolean

test is file exists and save timestamp

Parameters

\Smarty_Template_Source $source

source object

string $file

file name

Returns

boolean —

true if file exists

parseResourceName()

parseResourceName(string  $resource_name, string  $default_resource,   $name,   $type) : void

extract resource_type and resource_name from template_resource and config_resource

Parameters

string $resource_name

template_resource or config_resource to parse

string $default_resource

the default resource_type defined in $smarty

$name
$type