Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZTemplateLocaleOperator Class Reference
Template system » Template operators

Locale aware conversions and output using operator "l10n". More...

## Public Member Functions
| __construct ()
| operatorList ()
| operatorTemplateHints ()
| namedParameterPerOperator ()
| namedParameterList ()
| l10nTransformation ( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
| dateTimeTransformation ( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
| currentDateTransformation ( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
| makeDateTimeTransformation ( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
| getTimeTransformation ( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
| modify ( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement)

## Public Attributes
| $Operators
| $Locale
| A reference to the locale object. More...
| $LocaleName
| $DateTimeName
| $CurrentDateName
| $LocaleFetchName
| $MakeTimeName
| $MakeDateName
| $GetTimeName

## Detailed Description

Locale aware conversions and output using operator "l10n".

This class takes care of converting variables and displaying them according to their locale settings. The class has one operator called l10n (short for localization) which takes one parameter which is localization type. Supported types are time, shorttime, date, shortdate, currency and number.

// Example template code
{$curdate|l10n(date)}
{$cash|l10n(currency)}

Definition at line 29 of file eztemplatelocaleoperator.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZTemplateLocaleOperator::__construct | ( |  | ) |

Initializes the object with the default locale.

Todo:
  Add support for specifying the locale object.

Definition at line 36 of file eztemplatelocaleoperator.php.

## Member Function Documentation

## ◆ currentDateTransformation()

eZTemplateLocaleOperator::currentDateTransformation | ( |  | $operatorName,
|  | & | $node,
|  |  | $tpl,
|  | & | $resourceData,
|  |  | $element,
|  |  | $lastElement,
|  |  | $elementList,
|  |  | $elementTree,
|  | & | $parameters
| ) |  |

Definition at line 267 of file eztemplatelocaleoperator.php.

References eZTemplateNodeTool\createCodePieceElement().

## ◆ dateTimeTransformation()

eZTemplateLocaleOperator::dateTimeTransformation | ( |  | $operatorName,
|  | & | $node,
|  |  | $tpl,
|  | & | $resourceData,
|  |  | $element,
|  |  | $lastElement,
|  |  | $elementList,
|  |  | $elementTree,
|  | & | $parameters
| ) |  |

Definition at line 219 of file eztemplatelocaleoperator.php.

References eZTemplateNodeTool\createCodePieceElement(), eZTemplateNodeTool\elementConstantValue(), and eZTemplateNodeTool\isConstantElement().

## ◆ getTimeTransformation()

eZTemplateLocaleOperator::getTimeTransformation | ( |  | $operatorName,
|  | & | $node,
|  |  | $tpl,
|  | & | $resourceData,
|  |  | $element,
|  |  | $lastElement,
|  |  | $elementList,
|  |  | $elementTree,
|  | & | $parameters
| ) |  |

Definition at line 302 of file eztemplatelocaleoperator.php.

References eZTemplateNodeTool\createCodePieceElement().

## ◆ l10nTransformation()

eZTemplateLocaleOperator::l10nTransformation | ( |  | $operatorName,
|  | & | $node,
|  |  | $tpl,
|  | & | $resourceData,
|  |  | $element,
|  |  | $lastElement,
|  |  | $elementList,
|  |  | $elementTree,
|  | & | $parameters
| ) |  |

Transforms

Definition at line 128 of file eztemplatelocaleoperator.php.

References eZTemplateNodeTool\createCodePieceElement(), eZTemplateNodeTool\elementConstantValue(), eZLocale\instance(), and eZTemplateNodeTool\isConstantElement().

## ◆ makeDateTimeTransformation()

eZTemplateLocaleOperator::makeDateTimeTransformation | ( |  | $operatorName,
|  | & | $node,
|  |  | $tpl,
|  | & | $resourceData,
|  |  | $element,
|  |  | $lastElement,
|  |  | $elementList,
|  |  | $elementTree,
|  | & | $parameters
| ) |  |

Definition at line 275 of file eztemplatelocaleoperator.php.

References eZTemplateNodeTool\createCodePieceElement().

## ◆ modify()

eZTemplateLocaleOperator::modify | ( |  | $tpl,
|  |  | $operatorName,
|  |  | $operatorParameters,
|  |  | $rootNamespace,
|  |  | $currentNamespace,
|  | & | $operatorValue,
|  |  | $namedParameters,
|  |  | $placement
| ) |  |

Converts the variable according to the locale type. Allowed types are:

- time
- shorttime
- date
- shortdate
- currency
- clean_currency
- number

Definition at line 351 of file eztemplatelocaleoperator.php.

References eZLocale\instance().

## ◆ namedParameterList()

eZTemplateLocaleOperator::namedParameterList | ( |  | ) |

See eZTemplateOperator::namedParameterList

Definition at line 104 of file eztemplatelocaleoperator.php.

## ◆ namedParameterPerOperator()

eZTemplateLocaleOperator::namedParameterPerOperator | ( |  | ) |

Returns
  true to tell the template engine that the parameter list exists per operator type.

Definition at line 96 of file eztemplatelocaleoperator.php.

## ◆ operatorList()

eZTemplateLocaleOperator::operatorList | ( |  | ) |

Returns array with l10n.

Definition at line 51 of file eztemplatelocaleoperator.php.

References $Operators.

## ◆ operatorTemplateHints()

eZTemplateLocaleOperator::operatorTemplateHints | ( |  | ) |

Returns a list with hints for the template compiler.

Definition at line 59 of file eztemplatelocaleoperator.php.

## Member Data Documentation

## ◆ $CurrentDateName

eZTemplateLocaleOperator::$CurrentDateName

Definition at line 516 of file eztemplatelocaleoperator.php.

## ◆ $DateTimeName

eZTemplateLocaleOperator::$DateTimeName

Definition at line 515 of file eztemplatelocaleoperator.php.

## ◆ $GetTimeName

eZTemplateLocaleOperator::$GetTimeName

Definition at line 520 of file eztemplatelocaleoperator.php.

## ◆ $Locale

eZTemplateLocaleOperator::$Locale

A reference to the locale object.

Definition at line 512 of file eztemplatelocaleoperator.php.

## ◆ $LocaleFetchName

eZTemplateLocaleOperator::$LocaleFetchName

Definition at line 517 of file eztemplatelocaleoperator.php.

## ◆ $LocaleName

eZTemplateLocaleOperator::$LocaleName

Definition at line 514 of file eztemplatelocaleoperator.php.

## ◆ $MakeDateName

eZTemplateLocaleOperator::$MakeDateName

Definition at line 519 of file eztemplatelocaleoperator.php.

## ◆ $MakeTimeName

eZTemplateLocaleOperator::$MakeTimeName

Definition at line 518 of file eztemplatelocaleoperator.php.

## ◆ $Operators

eZTemplateLocaleOperator::$Operators

The operator array

Definition at line 510 of file eztemplatelocaleoperator.php.

Referenced by operatorList().

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

- eztemplatelocaleoperator.php

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