Properties

$uncompiled

$uncompiled : boolean

Flag that it's an uncompiled resource

Type

boolean

$recompiled

$recompiled : boolean

Source must be recompiled on every occasion

Type

boolean

$sysplugins

$sysplugins : array

resource types provided by the core

Type

array

$hasCompiledHandler

$hasCompiledHandler : boolean

Resource does implement populateCompiledFilepath() method

Type

boolean

$short_open_tag

$short_open_tag : string

container for short_open_tag directive's value before executing PHP templates

Type

string

Methods

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

getContent()

getContent(\Smarty_Template_Source  $source) : string

Load template's source from file into current template object

Parameters

\Smarty_Template_Source $source

source object

Throws

\SmartyException

if source cannot be loaded

Returns

string —

template source

getBasename()

getBasename(\Smarty_Template_Source  $source) : string

Determine basename for compiled filename

Parameters

\Smarty_Template_Source $source

source object

Returns

string —

resource's basename

buildUniqueResourceName()

buildUniqueResourceName(\Smarty  $smarty, string  $resource_name, boolean  $isConfig = false) : string

modify resource_name according to resource handlers specifications

Parameters

\Smarty $smarty

Smarty instance

string $resource_name

resource_name to make unique

boolean $isConfig

flag for config resource

Returns

string —

unique resource name

load()

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

Load Resource Handler

Parameters

\Smarty $smarty

smarty object

string $type

name of the resource

Throws

\SmartyException

Returns

\Smarty_Resource

Resource Handler

parseResourceName()

parseResourceName(string  $resource_name, string  $default_resource) : array

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

Returns

array —

with parsed resource name and type

getUniqueTemplateName()

getUniqueTemplateName(\Smarty_Internal_Template|\Smarty  $obj, string  $template_resource) : string

modify template_resource according to resource handlers specifications

Parameters

\Smarty_Internal_Template|\Smarty $obj

Smarty instance

string $template_resource

template_resource to extract resource handler and name of

Returns

string —

unique resource name

checkTimestamps()

checkTimestamps() 

source()

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

initialize Source Object for given resource wrapper for backward compatibility to versions < 3.1.22 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

__construct()

__construct() 

Create a new PHP Resource

renderUncompiled()

renderUncompiled(\Smarty_Template_Source  $source, \Smarty_Internal_Template  $_template) : void

Render and output the template (without using the compiler)

Parameters

\Smarty_Template_Source $source

source object

\Smarty_Internal_Template $_template

template object

Throws

\SmartyException

if template cannot be loaded or allow_php_templates is disabled

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 (is ignored)

renderUncompiled()

renderUncompiled(\Smarty_Template_Source  $source, \Smarty_Internal_Template  $_template) : void

Parameters

\Smarty_Template_Source $source
\Smarty_Internal_Template $_template

populateCompiledFilepath()

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

Parameters

\Smarty_Template_Compiled $compiled
\Smarty_Internal_Template $_template

process()

process(\Smarty_Internal_Template  $_smarty_tpl) : void

Parameters

\Smarty_Internal_Template $_smarty_tpl

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

Returns

string —

fully qualified filepath