lib/eztemplate/classes/eztemplate.php
File containing the eZTemplate class.
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- lib
- Version
- 4.6.0
\eZTemplate
File containing the eZTemplate class.
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Version
- 4.6.0
Constants
Properties


bool
$factory= 'false'
Factory flag as used by {@link eZTemplate::factory()} Reset with {@link eZTemplate::resetInstance()}
false
Details- Type
- bool


null|\eZTemplate
$instance= ''
Singelton instance of eZTemplate used by {@link eZTemplate::instance()} Reset with {@link eZTemplate::resetInstance()}
- Type
- null | \eZTemplate
Methods


appendDebugNodes(
$root, $resourceData
)
:
void
Name | Type | Description |
---|---|---|
$root | ||
$resourceData |


appendElement(
$text, $item, $nspace, $name
)
:
void
Name | Type | Description |
---|---|---|
$text | ||
$item | ||
$nspace | ||
$name |


appendElementText(
$textElements, $item, $nspace, $name
)
:
void
Name | Type | Description |
---|---|---|
$textElements | ||
$item | ||
$nspace | ||
$name |


appendTemplateFetch(
$actualTemplateName
)
:
void
Name | Type | Description |
---|---|---|
$actualTemplateName |


appendTemplateToStatistics(
$templateName, $templateFileName
)
:
void
Name | Type | Description |
---|---|---|
$templateName | ||
$templateFileName |


appendTemplateToStatisticsIfNeeded(
$templateName, $templateFileName
)
:
void
Name | Type | Description |
---|---|---|
$templateName | ||
$templateFileName |


canCompileTemplate(
$resourceData, $extraParameters
)
:
void
Name | Type | Description |
---|---|---|
$resourceData | ||
$extraParameters |


compileTemplate(
$resourceData, $extraParameters
)
:
void
Name | Type | Description |
---|---|---|
$resourceData | ||
$extraParameters |


compileTemplateFile(
$file, $returnResourceData
=
false
)
:
void
Name | Type | Description |
---|---|---|
$file | ||
$returnResourceData |


display(
$template
=
false, $extraParameters
=
false
)
:
void
Name | Type | Description |
---|---|---|
$template | ||
$extraParameters |


doFunction(
$name, $func_obj, $nspace, $current_nspace
)
:
void
Name | Type | Description |
---|---|---|
$name | ||
$func_obj | ||
$nspace | ||
$current_nspace |


doOperator(
$element, $namespace, $current_nspace, $value, $operatorName, $operatorParameters, $named_params
)
:
void
Name | Type | Description |
---|---|---|
$element | ||
$namespace | ||
$current_nspace | ||
$value | ||
$operatorName | ||
$operatorParameters | ||
$named_params |


elementValue(
$dataElements, $rootNamespace, $currentNamespace, $placement
=
false, $checkExistance
=
false, $checkForProxy
=
false
)
:
void
Name | Type | Description |
---|---|---|
$dataElements | ||
$rootNamespace | ||
$currentNamespace | ||
$placement | ||
$checkExistance | ||
$checkForProxy |


error(
$name, $txt, $placement
=
false
)
:
void
Name | Type | Description |
---|---|---|
$name | ||
$txt | ||
$placement |


executeCompiledTemplate(
$resourceData, $textElements, $rootNamespace, $currentNamespace, $extraParameters
)
:
void
Name | Type | Description |
---|---|---|
$resourceData | ||
$textElements | ||
$rootNamespace | ||
$currentNamespace | ||
$extraParameters |


expandAttributes(
$attributeList, $chooseText, $maxThreshold, $minThreshold
=
1
)
:
void
Name | Type | Description |
---|---|---|
$attributeList | ||
$chooseText | ||
$maxThreshold | ||
$minThreshold |


extraParameters(
$name, $count, $maxCount
)
:
void
Name | Type | Description |
---|---|---|
$name | ||
$count | ||
$maxCount |


factory(
)
:
\eZTemplate
Returns a shared instance of the eZTemplate class with default settings applied, like: - Autoload operators loaded - Debug mode set - eZTemplateDesignResource::instance registered
Type | Description |
---|---|
\eZTemplate |
- Since
- 4.3


fetch(
$template
=
false, $extraParameters
=
false, $returnResourceData
=
false
)
:
void
Name | Type | Description |
---|---|---|
$template | ||
$extraParameters | ||
$returnResourceData |


hasChildren(
$function, $functionName
)
:
void
Name | Type | Description |
---|---|---|
$function | ||
$functionName |


hasLocalVariable(
$varName, $rootNamespace
)
:
void
Name | Type | Description |
---|---|---|
$varName | ||
$rootNamespace |


hasVariable(
string $var, string $namespace
=
'', array $attrs
=
null
)
:
bool
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.
Name | Type | Description |
---|---|---|
$var | string | |
$namespace | string | (optional) |
$attrs | array | (optional) Deprecated as of 4.4. |
Type | Description |
---|---|
bool |


ini(
)
:
\eZINI
Returns the eZINI object instance for the template.ini file.
Type | Description |
---|---|
\eZINI |


instance(
)
:
\eZTemplate
Returns a shared instance of the eZTemplate class.
Type | Description |
---|---|
\eZTemplate |


load(
$uri, $extraParameters
=
false, $returnResourceData
=
false
)
:
void
Name | Type | Description |
---|---|---|
$uri | ||
$extraParameters | ||
$returnResourceData |


loadAndRegisterFunctions(
$functionDefinition
)
:
void
Name | Type | Description |
---|---|---|
$functionDefinition |


loadAndRegisterOperators(
$operatorDefinition
)
:
void
Name | Type | Description |
---|---|---|
$operatorDefinition |


loadURIData(
$resourceObject, $uri, $resourceName, $template, $extraParameters, $displayErrors
=
true
)
:
void
Name | Type | Description |
---|---|---|
$resourceObject | ||
$uri | ||
$resourceName | ||
$template | ||
$extraParameters | ||
$displayErrors |


loadURIRoot(
$uri, $displayErrors
=
true, $extraParameters
)
:
void
Name | Type | Description |
---|---|---|
$uri | ||
$displayErrors | ||
$extraParameters |


mergeNamespace(
$rootNamespace, $additionalNamespace
)
:
void
Name | Type | Description |
---|---|---|
$rootNamespace | ||
$additionalNamespace |


parse(
$sourceText, $rootElement, $rootNamespace, $resourceData
)
:
void
Name | Type | Description |
---|---|---|
$sourceText | ||
$rootElement | ||
$rootNamespace | ||
$resourceData |


process(
$root, $text, $rootNamespace, $currentNamespace
)
:
void
Name | Type | Description |
---|---|---|
$root | ||
$text | ||
$rootNamespace | ||
$currentNamespace |


processFunction(
$functionName, $textElements, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace
)
:
void
Name | Type | Description |
---|---|---|
$functionName | ||
$textElements | ||
$functionChildren | ||
$functionParameters | ||
$functionPlacement | ||
$rootNamespace | ||
$currentNamespace |


processNode(
$node, $textElements, $rootNamespace, $currentNamespace
)
:
void
Name | Type | Description |
---|---|---|
$node | ||
$textElements | ||
$rootNamespace | ||
$currentNamespace |


processOperator(
$operatorName, $operatorParameters, $rootNamespace, $currentNamespace, $valueData, $placement
=
false, $checkExistance
=
false
)
:
void
Name | Type | Description |
---|---|---|
$operatorName | ||
$operatorParameters | ||
$rootNamespace | ||
$currentNamespace | ||
$valueData | ||
$placement | ||
$checkExistance |


processURI(
$uri, $displayErrors
=
true, $extraParameters, $textElements, $rootNamespace, $currentNamespace
)
:
void
Name | Type | Description |
---|---|---|
$uri | ||
$displayErrors | ||
$extraParameters | ||
$textElements | ||
$rootNamespace | ||
$currentNamespace |


processVariable(
$textElements, $variableData, $variablePlacement, $rootNamespace, $currentNamespace
)
:
void
Name | Type | Description |
---|---|---|
$textElements | ||
$variableData | ||
$variablePlacement | ||
$rootNamespace | ||
$currentNamespace |


registerAutoloadFunctions(
$functionDefinition
)
:
void
Name | Type | Description |
---|---|---|
$functionDefinition |


registerAutoloadOperators(
$operatorDefinition
)
:
void
Name | Type | Description |
---|---|---|
$operatorDefinition |


registerFunction(
$func_name, $func_obj
)
:
void
Name | Type | Description |
---|---|---|
$func_name | ||
$func_obj |


registerFunctionsInternal(
$functionObject, $debug
=
false
)
:
void
Name | Type | Description |
---|---|---|
$functionObject | ||
$debug |


registerOperatorsInternal(
$operatorObject, $debug
=
false
)
:
void
Name | Type | Description |
---|---|---|
$operatorObject | ||
$debug |


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


resourceData(
$resourceObject, $uri, $resourceName, $templateName
)
:
void
Name | Type | Description |
---|---|---|
$resourceObject | ||
$uri | ||
$resourceName | ||
$templateName |


setLocalVariable(
$varName, $varValue, $rootNamespace
)
:
void
Name | Type | Description |
---|---|---|
$varName | ||
$varValue | ||
$rootNamespace |


setVariable(
string $var, string $val, string $namespace
=
'', bool $scopeSafe
=
false
)
:
void
Sets the template variable $var to the value $val.
Name | Type | Description |
---|---|---|
$var | string | |
$val | string | |
$namespace | string | (optional) |
$scopeSafe | bool | If true, will assure that $var is not overridden for $namespace. False by default |
- Used_by
- \eZTemplate::setVariableRef()


setVariableRef(
string $var, string $val, string $namespace
=
''
)
:
void
Sets the template variable $var to the value $val by ref
Name | Type | Description |
---|---|---|
$var | string | |
$val | string | |
$namespace | string | (optional) |
- Deprecated
- Since 4.4, have not used references since 3.10
- Uses
- \eZTemplate::setVariable()


unsetLocalVariable(
$varName, $rootNamespace
)
:
void
Name | Type | Description |
---|---|---|
$varName | ||
$rootNamespace |


unsetVariable(
string $var, string $namespace
=
''
)
:
void
Unsets the template variable $var.
Name | Type | Description |
---|---|---|
$var | string | |
$namespace | string | (optional) |


validateTemplateFile(
$file, $returnResourceData
=
false
)
:
void
Name | Type | Description |
---|---|---|
$file | ||
$returnResourceData |


variable(
string $var, string $namespace
=
'', array $attrs
=
null
)
:
string | array
Returns the content of the variable $var using namespace $namespace, if $attrs is supplied the result of the attributes is returned.
Name | Type | Description |
---|---|---|
$var | string | |
$namespace | string | (optional) |
$attrs | array | (optional) Deprecated as of 4.4 |
Type | Description |
---|---|
string | array |


variableText(
$var, $namespace
=
"", $attrs
=
array()
)
:
void
Name | Type | Description |
---|---|---|
$var | ||
$namespace | ||
$attrs |


warning(
$name, $txt, $placement
=
false
)
:
void
Name | Type | Description |
---|---|---|
$name | ||
$txt | ||
$placement |