eZ Publish Community Project (Legacy Stack) 2013.4
Class

eZTemplate

class eZTemplate

Constants

RESOURCE_FETCH

RESOURCE_QUERY

ELEMENT_TEXT

ELEMENT_SINGLE_TAG

ELEMENT_NORMAL_TAG

ELEMENT_END_TAG

ELEMENT_VARIABLE

ELEMENT_COMMENT

NODE_ROOT

NODE_TEXT

NODE_VARIABLE

NODE_FUNCTION

NODE_OPERATOR

NODE_INTERNAL

NODE_INTERNAL_CODE_PIECE

NODE_INTERNAL_VARIABLE_SET

NODE_INTERNAL_VARIABLE_UNSET

NODE_INTERNAL_NAMESPACE_CHANGE

NODE_INTERNAL_NAMESPACE_RESTORE

NODE_INTERNAL_WARNING

NODE_INTERNAL_ERROR

NODE_INTERNAL_RESOURCE_ACQUISITION

NODE_OPTIMIZED_RESOURCE_ACQUISITION

NODE_INTERNAL_OUTPUT_ASSIGN

NODE_INTERNAL_OUTPUT_READ

NODE_INTERNAL_OUTPUT_INCREASE

NODE_INTERNAL_OUTPUT_DECREASE

NODE_INTERNAL_OUTPUT_SPACING_INCREASE

NODE_INTERNAL_SPACING_DECREASE

NODE_OPTIMIZED_INIT

NODE_USER_CUSTOM

TYPE_VOID

TYPE_STRING

TYPE_NUMERIC

TYPE_IDENTIFIER

TYPE_VARIABLE

TYPE_ATTRIBUTE

TYPE_OPERATOR

TYPE_BOOLEAN

TYPE_ARRAY

TYPE_DYNAMIC_ARRAY

TYPE_INTERNAL

TYPE_INTERNAL_CODE_PIECE

TYPE_PHP_VARIABLE

TYPE_OPTIMIZED_NODE

TYPE_OPTIMIZED_ARRAY_LOOKUP

TYPE_OPTIMIZED_CONTENT_CALL

TYPE_OPTIMIZED_ATTRIBUTE_LOOKUP

TYPE_INTERNAL_STOP

TYPE_STRING_BIT

TYPE_NUMERIC_BIT

TYPE_IDENTIFIER_BIT

TYPE_VARIABLE_BIT

TYPE_ATTRIBUTE_BIT

TYPE_OPERATOR_BIT

TYPE_NONE

TYPE_ALL

TYPE_BASIC

TYPE_MODIFIER_MASK

NAMESPACE_SCOPE_GLOBAL

NAMESPACE_SCOPE_LOCAL

NAMESPACE_SCOPE_RELATIVE

DEBUG_INTERNALS

FILE_ERRORS

Properties

$Resources
$DefaultResource
$Text
$IncludeText
$IncludeOutput
$TimeStamp
$LDelim
$RDelim
$Tree
$Variables
$LocalVariablesNamesStack
$CurrentLocalVariablesNames
$Operators
$Functions
$FunctionAttributes
$Literals
$ShowDetails
$IsCachingAllowed
$ErrorLog
$WarningLog
$AutoloadPathList
$Level
$MaxLevel
$TemplatesUsageStatistics
$ForeachCounter
$ForCounter
$WhileCounter
$DoCounter
$ElseifCounter
$TestCompile

Methods

eZTemplate()

leftDelimiter()

rightDelimiter()

setLeftDelimiter($delim)

setRightDelimiter($delim)

display($template = false, $extraParameters = false)

createLocalVariablesList()

hasLocalVariable($varName, $rootNamespace)

setLocalVariable($varName, $varValue, $rootNamespace)

unsetLocalVariable($varName, $rootNamespace)

unsetLocalVariables()

destroyLocalVariablesList()

fetch($template = false, $extraParameters = false, $returnResourceData = false)

process($root, $text, $rootNamespace, $currentNamespace)

processNode($node, $textElements, $rootNamespace, $currentNamespace)

processVariable($textElements, $variableData, $variablePlacement, $rootNamespace, $currentNamespace)

processFunction($functionName, $textElements, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace)

fetchFunctionObject($functionName)

load($uri, $extraParameters = false, $returnResourceData = false)

parse($sourceText, $rootElement, $rootNamespace, $resourceData)

loadURIData($resourceObject, $uri, $resourceName, $template, $extraParameters, $displayErrors = true)

resourceData($resourceObject, $uri, $resourceName, $templateName)

loadURIRoot($uri, $displayErrors = true, $extraParameters)

processURI($uri, $displayErrors = true, $extraParameters, $textElements, $rootNamespace, $currentNamespace)

canCompileTemplate($resourceData, $extraParameters)

validateTemplateFile($file, $returnResourceData = false)

compileTemplateFile($file, $returnResourceData = false)

compileTemplate($resourceData, $extraParameters)

executeCompiledTemplate($resourceData, $textElements, $rootNamespace, $currentNamespace, $extraParameters)

resourceFor($uri, $res, $template)

resourceHandler($resourceName)

hasChildren($function, $functionName)

emptyVariable()

mergeNamespace($rootNamespace, $additionalNamespace)

elementValue($dataElements, $rootNamespace, $currentNamespace, $placement = false, $checkExistance = false, $checkForProxy = false)

expandAttributes($attributeList, $chooseText, $maxThreshold, $minThreshold = 1)

processOperator($operatorName, $operatorParameters, $rootNamespace, $currentNamespace, $valueData, $placement = false, $checkExistance = false)

attributeValue($data, $nspace)

variableText($var, $namespace = '', $attrs = array())

operatorParameterList($name)

doOperator($element, $namespace, $current_nspace, $value, $operatorName, $operatorParameters, $named_params)

doFunction($name, $func_obj, $nspace, $current_nspace)

setVariable(string $var, string $val, string $namespace = '', bool $scopeSafe = false)

Sets the template variable $var to the value $val.

unsetVariable(string $var, string $namespace = '')

Unsets the template variable $var.

bool hasVariable(string $var, string $namespace = '', array $attrs = null)

Returns true if the variable $var is set in namespace $namespace, if $attrs is supplied all attributes must exist for the function to return true.

string|array variable(string $var, string $namespace = '', array $attrs = null)

Returns the content of the variable $var using namespace $namespace, if $attrs is supplied the result of the attributes is returned.

variableAttribute($var, $attrs)

appendElement($text, $item, $nspace, $name)

appendElementText($textElements, $item, $nspace, $name)

appendDebugNodes($root, $resourceData)

registerFunctions($functionObject)

registerAutoloadFunctions($functionDefinition)

loadAndRegisterFunctions($functionDefinition)

registerFunctionsInternal($functionObject, $debug = false)

registerFunction($func_name, $func_obj)

registerLiteral($func_name)

unregisterLiteral($func_name)

registerAutoloadOperators($operatorDefinition)

loadAndRegisterOperators($operatorDefinition)

registerOperators($operatorObject)

registerOperatorsInternal($operatorObject, $debug = false)

registerOperator($op_name, $op_obj)

unregisterOperator($op_name)

registerFilter()

registerResource($res)

unregisterResource($res_name)

setShowDetails($show)

missingParameter($name, $param)

extraParameters($name, $count, $maxCount)

undefinedVariable($name, $var)

undefinedFunction($func_name)

placementText($placement = false)

warning($name, $txt, $placement = false)

error($name, $txt, $placement = false)

operatorInputSupported($operatorName)

setIncludeText($uri, $text)

setIncludeOutput($uri, $output)

autoloadPathList()

setAutoloadPathList($pathList)

autoload()

resetVariables()

resetElements()

reset()

errorCount()

hasErrors()

errorLog()

warningCount()

hasWarnings()

warningLog()

static eZTemplate instance()

Returns a shared instance of the eZTemplate class.

static eZTemplate factory()

Returns a shared instance of the eZTemplate class with default settings applied, like: - Autoload operators loaded - Debug mode set - eZTemplateDesignResource::instance registered

static  resetInstance()

Reset shared instance of the eZTemplate class and factory flag as used by {@link eZTemplate::instance()} and {@link eZTemplate::factory()}

eZINI ini()

Returns the eZINI object instance for the template.ini file.

isCachingAllowed()

setIsCachingAllowed($allowed)

setIsTemplatesUsageStatisticsEnabled($enabled)

appendTemplateToStatisticsIfNeeded($templateName, $templateFileName)

appendTemplateToStatistics($templateName, $templateFileName)

appendTemplateFetch($actualTemplateName)

resetErrorLog()

templateFetchList()

setCompileTest($val)

testCompile()

Details

at line 296
public eZTemplate()

at line 351
public leftDelimiter()

at line 359
public rightDelimiter()

at line 367
public setLeftDelimiter($delim)

Parameters

$delim

at line 375
public setRightDelimiter($delim)

Parameters

$delim

at line 384
public display($template = false, $extraParameters = false)

Parameters

$template
$extraParameters

at line 428
public createLocalVariablesList()

at line 437
public hasLocalVariable($varName, $rootNamespace)

Parameters

$varName
$rootNamespace

at line 446
public setLocalVariable($varName, $varValue, $rootNamespace)

Parameters

$varName
$varValue
$rootNamespace

at line 455
public unsetLocalVariable($varName, $rootNamespace)

Parameters

$varName
$rootNamespace

at line 467
public unsetLocalVariables()

at line 479
public destroyLocalVariablesList()

at line 493
public fetch($template = false, $extraParameters = false, $returnResourceData = false)

Parameters

$template
$extraParameters
$returnResourceData

at line 567
public process($root, $text, $rootNamespace, $currentNamespace)

Parameters

$root
$text
$rootNamespace
$currentNamespace

at line 582
public processNode($node, $textElements, $rootNamespace, $currentNamespace)

Parameters

$node
$textElements
$rootNamespace
$currentNamespace

at line 625
public processVariable($textElements, $variableData, $variablePlacement, $rootNamespace, $currentNamespace)

Parameters

$textElements
$variableData
$variablePlacement
$rootNamespace
$currentNamespace

at line 631
public processFunction($functionName, $textElements, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace)

Parameters

$functionName
$textElements
$functionChildren
$functionParameters
$functionPlacement
$rootNamespace
$currentNamespace

at line 658
public fetchFunctionObject($functionName)

Parameters

$functionName

at line 674
public load($uri, $extraParameters = false, $returnResourceData = false)

Parameters

$uri
$extraParameters
$returnResourceData

at line 687
public parse($sourceText, $rootElement, $rootNamespace, $resourceData)

Parameters

$sourceText
$rootElement
$rootNamespace
$resourceData

at line 693
public loadURIData($resourceObject, $uri, $resourceName, $template, $extraParameters, $displayErrors = true)

Parameters

$resourceObject
$uri
$resourceName
$template
$extraParameters
$displayErrors

at line 721
public resourceData($resourceObject, $uri, $resourceName, $templateName)

Parameters

$resourceObject
$uri
$resourceName
$templateName

at line 740
public loadURIRoot($uri, $displayErrors = true, $extraParameters)

Parameters

$uri
$displayErrors
$extraParameters

at line 797
public processURI($uri, $displayErrors = true, $extraParameters, $textElements, $rootNamespace, $currentNamespace)

Parameters

$uri
$displayErrors
$extraParameters
$textElements
$rootNamespace
$currentNamespace

at line 853
public canCompileTemplate($resourceData, $extraParameters)

Parameters

$resourceData
$extraParameters

at line 867
public validateTemplateFile($file, $returnResourceData = false)

Parameters

$file
$returnResourceData

at line 914
public compileTemplateFile($file, $returnResourceData = false)

Parameters

$file
$returnResourceData

at line 960
public compileTemplate($resourceData, $extraParameters)

Parameters

$resourceData
$extraParameters

at line 972
public executeCompiledTemplate($resourceData, $textElements, $rootNamespace, $currentNamespace, $extraParameters)

Parameters

$resourceData
$textElements
$rootNamespace
$currentNamespace
$extraParameters

at line 995
public resourceFor($uri, $res, $template)

Parameters

$uri
$res
$template

at line 1020
public resourceHandler($resourceName)

Parameters

$resourceName

at line 1030
public hasChildren($function, $functionName)

Parameters

$function
$functionName

at line 1042
public emptyVariable()

at line 1050
public mergeNamespace($rootNamespace, $additionalNamespace)

Parameters

$rootNamespace
$additionalNamespace

at line 1063
public elementValue($dataElements, $rootNamespace, $currentNamespace, $placement = false, $checkExistance = false, $checkForProxy = false)

Parameters

$dataElements
$rootNamespace
$currentNamespace
$placement
$checkExistance
$checkForProxy

at line 1266
public expandAttributes($attributeList, $chooseText, $maxThreshold, $minThreshold = 1)

Parameters

$attributeList
$chooseText
$maxThreshold
$minThreshold

at line 1298
public processOperator($operatorName, $operatorParameters, $rootNamespace, $currentNamespace, $valueData, $placement = false, $checkExistance = false)

Parameters

$operatorName
$operatorParameters
$rootNamespace
$currentNamespace
$valueData
$placement
$checkExistance

at line 1362
public attributeValue($data, $nspace)

Parameters

$data
$nspace

at line 1389
public variableText($var, $namespace = '', $attrs = array())

Parameters

$var
$namespace
$attrs

at line 1403
public operatorParameterList($name)

Parameters

$name

at line 1436
public doOperator($element, $namespace, $current_nspace, $value, $operatorName, $operatorParameters, $named_params)

Parameters

$element
$namespace
$current_nspace
$value
$operatorName
$operatorParameters
$named_params

at line 1454
public doFunction($name, $func_obj, $nspace, $current_nspace)

Parameters

$name
$func_obj
$nspace
$current_nspace

at line 1482
public setVariable(string $var, string $val, string $namespace = '', bool $scopeSafe = false)

Sets the template variable $var to the value $val.

Parameters

string $var
string $val
string $namespace (optional)
bool $scopeSafe If true, will assure that $var is not overridden for $namespace. False by default

at line 1505
public unsetVariable(string $var, string $namespace = '')

Unsets the template variable $var.

Parameters

string $var
string $namespace (optional)

at line 1544
public bool hasVariable(string $var, string $namespace = '', array $attrs = null)

Returns true if the variable $var is set in namespace $namespace, if $attrs is supplied all attributes must exist for the function to return true.

Parameters

string $var
string $namespace (optional)
array $attrs (optional) Deprecated as of 4.4.

Return Value

bool

at line 1589
public string|array variable(string $var, string $namespace = '', array $attrs = null)

Returns the content of the variable $var using namespace $namespace, if $attrs is supplied the result of the attributes is returned.

Parameters

string $var
string $namespace (optional)
array $attrs (optional) Deprecated as of 4.4

Return Value

string|array

at line 1643
public variableAttribute($var, $attrs)

Parameters

$var
$attrs

at line 1682
public appendElement($text, $item, $nspace, $name)

Parameters

$text
$item
$nspace
$name

at line 1688
public appendElementText($textElements, $item, $nspace, $name)

Parameters

$textElements
$item
$nspace
$name

at line 1734
public appendDebugNodes($root, $resourceData)

Parameters

$root
$resourceData

at line 1771
public registerFunctions($functionObject)

Parameters

$functionObject

at line 1776
public registerAutoloadFunctions($functionDefinition)

Parameters

$functionDefinition

at line 1811
public loadAndRegisterFunctions($functionDefinition)

Parameters

$functionDefinition

at line 1844
public registerFunctionsInternal($functionObject, $debug = false)

Parameters

$functionObject
$debug

at line 1872
public registerFunction($func_name, $func_obj)

Parameters

$func_name
$func_obj

at line 1889
public registerLiteral($func_name)

Parameters

$func_name

at line 1897
public unregisterLiteral($func_name)

Parameters

$func_name

at line 1902
public registerAutoloadOperators($operatorDefinition)

Parameters

$operatorDefinition

at line 1930
public loadAndRegisterOperators($operatorDefinition)

Parameters

$operatorDefinition

at line 1966
public registerOperators($operatorObject)

Parameters

$operatorObject

at line 1971
public registerOperatorsInternal($operatorObject, $debug = false)

Parameters

$operatorObject
$debug

at line 1985
public registerOperator($op_name, $op_obj)

Parameters

$op_name
$op_obj

at line 1993
public unregisterOperator($op_name)

Parameters

$op_name

at line 2011
public registerFilter()

at line 2019
public registerResource($res)

Parameters

$res

at line 2030
public unregisterResource($res_name)

Parameters

$res_name

at line 2050
public setShowDetails($show)

Parameters

$show

at line 2058
public missingParameter($name, $param)

Parameters

$name
$param

at line 2066
public extraParameters($name, $count, $maxCount)

Parameters

$name
$count
$maxCount

at line 2074
public undefinedVariable($name, $var)

Parameters

$name
$var

at line 2082
public undefinedFunction($func_name)

Parameters

$func_name

at line 2091
public placementText($placement = false)

Parameters

$placement

at line 2119
public warning($name, $txt, $placement = false)

Parameters

$name
$txt
$placement

at line 2139
public error($name, $txt, $placement = false)

Parameters

$name
$txt
$placement

at line 2173
public operatorInputSupported($operatorName)

Parameters

$operatorName

at line 2180
public setIncludeText($uri, $text)

Parameters

$uri
$text

at line 2188
public setIncludeOutput($uri, $output)

Parameters

$uri
$output

at line 2196
public autoloadPathList()

at line 2204
public setAutoloadPathList($pathList)

Parameters

$pathList

at line 2213
public autoload()

at line 2253
public resetVariables()

at line 2262
public resetElements()

at line 2286
public reset()

at line 2302
public errorCount()

at line 2311
public hasErrors()

at line 2320
public errorLog()

at line 2329
public warningCount()

at line 2338
public hasWarnings()

at line 2347
public warningLog()

at line 2357
static public eZTemplate instance()

Returns a shared instance of the eZTemplate class.

Return Value

eZTemplate

at line 2376
static public eZTemplate factory()

Returns a shared instance of the eZTemplate class with default settings applied, like: - Autoload operators loaded - Debug mode set - eZTemplateDesignResource::instance registered

Return Value

eZTemplate

at line 2411
static public resetInstance()

Reset shared instance of the eZTemplate class and factory flag as used by {@link eZTemplate::instance()} and {@link eZTemplate::factory()}

at line 2422
public eZINI ini()

Returns the eZINI object instance for the template.ini file.

Return Value

eZINI

at line 2484
public isCachingAllowed()

at line 2496
public setIsCachingAllowed($allowed)

Parameters

$allowed

at line 2520
public setIsTemplatesUsageStatisticsEnabled($enabled)

Parameters

$enabled

at line 2534
public appendTemplateToStatisticsIfNeeded($templateName, $templateFileName)

Parameters

$templateName
$templateFileName

at line 2544
public appendTemplateToStatistics($templateName, $templateFileName)

Parameters

$templateName
$templateFileName

at line 2578
public appendTemplateFetch($actualTemplateName)

Parameters

$actualTemplateName

at line 2587
public resetErrorLog()

at line 2606
public templateFetchList()

at line 2617
public setCompileTest($val)

Parameters

$val

at line 2625
public testCompile()