Dotiac::DTL::Tag::load - The {% load NAME %} tag
Template file:
{% load markup %} {{ post.text|markdown }}
Loads a library with a specific NAME, which may contain additional filters, tags or custom locale stettings. See Dotiac::DTL::Addon for details.
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.
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 #}
http://www.djangoproject.com, Dotiac::DTL
Dotiac::DTL was built according to http://docs.djangoproject.com/en/dev/ref/templates/builtins/.
Marc-Sebastian Lucksch
perl@marc-s.de
To install Dotiac::DTL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dotiac::DTL
CPAN shell
perl -MCPAN -e shell install Dotiac::DTL
For more information on module installation, please visit the detailed CPAN module installation guide.