The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Dotiac::DTL::Tag::load - The {% load NAME %} tag

SYNOPSIS

Template file:

        {% load markup %}
        {{ post.text|markdown }}

DESCRIPTION

Loads a library with a specific NAME, which may contain additional filters, tags or custom locale stettings. See Dotiac::DTL::Addon for details.

BUGS AND DIFFERENCES TO DJANGO

This can't work at all like Django's {% load %}, since that one requires python. This implementation requires "Dotiac::DTL::Addon::$NAME", with all non-word characters in $NAME replace with underlines "_". It then calls the import() method of that module. See also Dotiac::DTL::Addon for that.

Example:

        {% load Foo.bar+this %}

tries to require Django/Template/Addon/Foo_bar_this.pm and calls Dotiac::DTL::Foo_bar_this->import().

After the rendering is completed, Dotiac::DTL::Foo_bar_this->unimport() is called before the next render process.

Warning

Dotiac::DTL keeps the loaded locales and loaded addons active even after an include.

common.html:

        {% load addon1 addon2 addon3 klingon_locale %}

page.html:

        {% include "common.html" %}
        {{ a|addon1 }} {# This won't work in Django #}

SEE ALSO

http://www.djangoproject.com, Dotiac::DTL

LEGAL

Dotiac::DTL was built according to http://docs.djangoproject.com/en/dev/ref/templates/builtins/.

AUTHOR

Marc-Sebastian Lucksch

perl@marc-s.de