OTRS 4.0 API Reference Perl

Description manuals and libraries
OTRS 4.0 API Reference Perl > Perl Modules > Kernel::Output::Template::Plugin::OTRS

NAME

Kernel::Output::Template::Plugin::OTRS - Template Toolkit extension plugin

PUBLIC INTERFACE

new()

this plugin registers a few filters and functions in Template::Toolkit.

These extensions have names starting with an uppercase letter so that you can distinguish them from the builtins of Template::Toolkit which are always lowercase.

Filters:

    [% Data.MyData  | Translate %]              - Translate to user language.

    [% Data.Created | Localize("TimeLong") %]   - Format DateTime string according to user's locale.
    [% Data.Created | Localize("TimeShort") %]  - Format DateTime string according to user's locale, without seconds.
    [% Data.Created | Localize("Date") %]       - Format DateTime string according to user's locale, only date.

    [% Data.Complex | Interpolate %]            - Treat Data.Complex as a TT template and parse it.

    [% Data.Complex | JSON %]                   - Convert Data.Complex into a JSON string.

Functions:

    [% Translate("Test string for %s", "Documentation") %]  - Translate text, with placeholders.

    [% Config("Home") %]    - Get SysConfig configuration value.

    [% Env("Baselink") %]   - Get environment value of LayoutObject.

TERMS AND CONDITIONS

This software is part of the OTRS project (https://otrs.org/).

This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.