Kernel::Output::HTML::Layout::Template – template rendering engine based on Template::Toolkit



generates HTML output based on a template file.

Using a template file:

    my $HTML = $LayoutObject->Output(
        TemplateFile => '',
        Data         => \%Param,

Using a template string:

    my $HTML = $LayoutObject->Output(
        Template => '<b>[% Data.SomeKey | html %]</b>',
        Data     => \%Param,

Additional parameters:

    AJAX - AJAX-specific adjustements: this causes [% WRAPPER JSOnDocumentComplete %] blocks NOT
        to be replaced. This is important to be able to generate snippets which can be cached.
        Also, JS data added with AddJSData() calls is appended to the output here.

    my $HTML = $LayoutObject->Output(
        TemplateFile   => '',
        Data           => \%Param,
        AJAX           => 1,

    KeepScriptTags - DEPRECATED, please use the parameter "AJAX" instead


dynamically add JavaScript code that should be executed in Core.App.Ready(). Call this for any dynamically generated code that is not in a template.

        Code => $MyCode,


dynamically add JavaScript data that should be handed over to JavaScript via Core.Config.

        Key   => 'Key1',  # the key to store this data
        Value => { ... }  # simple or complex data
Scroll to Top