Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZTemplateIncludeFunction Class Reference
Template system » Template functions

Includes external template code using function "include". More...

## Public Member Functions
| __construct ( $inc_name="include")
| functionList ()
| functionTemplateHints ()
| templateNodeTransformation ( $functionName, &$node, $tpl, $parameters, $privateData)
| process ( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace)
| hasChildren ()

## Static Public Member Functions
static | handleInclude (&$textElements, &$uri, $tpl, $rootNamespace, $name)

## Public Attributes
| $IncludeName

## Detailed Description

Includes external template code using function "include".

Allows the template designer to include another template file dynamically. This allows for reuse of commonly used template code. The new template file will loaded into the current namespace or a namspace specified by the template designer, any extra parameters to this function is set as template variables for the template file using the newly aquired namespace.

// Example template code
{include uri=file:myfile.tpl}
{include name=new_namespace uri=/etc/test.tpl}

Definition at line 32 of file eztemplateincludefunction.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZTemplateIncludeFunction::__construct | ( |  | $inc_name = `"include"` | ) |

Initializes the function with the function name $inc_name.

Parameters

  string | $inc_name |

Definition at line 39 of file eztemplateincludefunction.php.

## Member Function Documentation

## ◆ functionList()

eZTemplateIncludeFunction::functionList | ( |  | ) |

Returns an array of the function names, required for eZTemplate::registerFunctions.

Definition at line 47 of file eztemplateincludefunction.php.

## ◆ functionTemplateHints()

eZTemplateIncludeFunction::functionTemplateHints | ( |  | ) |

Definition at line 52 of file eztemplateincludefunction.php.

## ◆ handleInclude()

static eZTemplateIncludeFunction::handleInclude | ( | & | $textElements,
|  | & | $uri,
|  |  | $tpl,
|  |  | $rootNamespace,
|  |  | $name
| ) |  |
| static

Takes care of loading the template file and set it in the $text parameter.

Definition at line 203 of file eztemplateincludefunction.php.

Referenced by eZTemplate\appendElementText(), process(), and eZXMLOutputHandler\renderTag().

## ◆ hasChildren()

eZTemplateIncludeFunction::hasChildren | ( |  | ) |

Returns false, telling the template parser that this is a single tag.

Definition at line 211 of file eztemplateincludefunction.php.

## ◆ process()

eZTemplateIncludeFunction::process | ( |  | $tpl,
|  | & | $textElements,
|  |  | $functionName,
|  |  | $functionChildren,
|  |  | $functionParameters,
|  |  | $functionPlacement,
|  |  | $rootNamespace,
|  |  | $currentNamespace
| ) |  |

Loads the file specified in the parameter "uri" with namespace "name".

Definition at line 138 of file eztemplateincludefunction.php.

References handleInclude().

## ◆ templateNodeTransformation()

eZTemplateIncludeFunction::templateNodeTransformation | ( |  | $functionName,
|  | & | $node,
|  |  | $tpl,
|  |  | $parameters,
|  |  | $privateData
| ) |  |

Definition at line 61 of file eztemplateincludefunction.php.

References eZTemplateNodeTool\createCodePieceNode(), eZTemplateNodeTool\createVariableNode(), eZTemplateNodeTool\elementConstantValue(), eZTemplateNodeTool\extractFunctionNodeParameters(), eZTemplateCompiler\isCommentsEnabled(), eZTemplateNodeTool\isConstantElement(), and eZTemplate\NAMESPACE_SCOPE_RELATIVE.

## Member Data Documentation

## ◆ $IncludeName

eZTemplateIncludeFunction::$IncludeName

The name of the include function

Definition at line 218 of file eztemplateincludefunction.php.

The documentation for this class was generated from the following file:

- eztemplateincludefunction.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.