Dotiac::DTL::Tag::url - The {% url PATH,[PATH,[...],[PARAMETER=VALUE,[PARAMETER=VALUE,[..]]] [as VAR] %} tag
Template file:
{% url "forum","thread",variable,"id"=post.id %} {# forum/thread/444/?id=556 #} {% url "","forum","thread",variable,"id"=post.id %} {# /forum/thread/444/?id=556 #} {% url "http://www.google.com","forum","thread",variable,"id"=post.id %} {# http://www.google.com/forum/thread/444/?id=556 #} {% url "http://www.google.com","forum","thread",variable,"id"=post.id as link_url %} {# <nothing> #} {{ link_url|upper|safe }} {# HTTP://WWW.GOOGLE.COM/FORUM/THREAD/444/?ID=556 #}
Generates an url from a joined PATH and adds also PARAMETERs with VALUES for get-queries.
When provided with an "as" and a variable name, it will output nothing and save the url into a variable, which can be used for further processing.
the PATH, PARAMETERs and VALUES are automatically url-encoded.
The normal Django {% url %} tag gets as a first parameter the name of Django-view, since there is no Django backend in this implementation, this is not possible.
When writing the url into a variable, that variable has to be marked safe manually, using the safe Filter (See Dotiac::DTL::Filter)
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.