NAME

Maplat::Web::TemplateCache - provide template caching and rendering

SYNOPSIS

This module provides template rendering as well as caching the template files

DESCRIPTION

During the reload() calls, this modules loads all template files in the configured directory into RAM and renders them quite fast.

The template rendering can optionally use "meta" rendering with a base template. This is for example used to render the complete layout of a page, and modules only have templates that use only the changing part of the page - this way, you only have to have one global layout and only write the changing part of the page for every module.

Configuration

<module>
        <modname>templates</modname>
        <pm>TemplateCache</pm>
        <options>
                <path>MaplatWeb/Templates</path>
                <!-- Layout-Template to use for complete pages -->
                <layout>maplatlayout</layout>
        </options>
</module>

layout is the template name used in meta-rendering.

get

The one public function to call in this module is get(), in the form of:

$templatehandle->get($name, $uselayout, %webdata);

$name if the name of the template file (without the .tt suffix)

$uselayout is a boolean, indicating if meta-rendering with the configured layout.

%webdata is a hash that is passed through to the template toolkit.

load_dir

Internal function.

Dependencies

This module is a basic web module and does not depend on other web modules.

SEE ALSO

Maplat::Web

AUTHOR

Rene Schickbauer, <rene.schickbauer@magnapowertrain.com>

COPYRIGHT AND LICENSE

Copyright (C) 2009 by Rene Schickbauer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.