[Templates-cvs] cvs commit: Template2/docsrc/src/Modules/Template/Plugin URL.tt2
cvs@template-toolkit.org
cvs@template-toolkit.org
cvs 06/01/30 17:45:27
Modified: docsrc/src/Modules/Template/Plugin URL.tt2
Log:
* added comment about $JOINT
Revision Changes Path
1.2 +10 -11 Template2/docsrc/src/Modules/Template/Plugin/URL.tt2
Index: URL.tt2
===================================================================
RCS file: /template-toolkit/Template2/docsrc/src/Modules/Template/Plugin/URL.tt2,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- URL.tt2 2001/03/29 22:10:51 1.1
+++ URL.tt2 2006/01/30 17:45:26 1.2
@@ -43,8 +43,16 @@
/cgi-bin/bar.pl?mode=browse
/cgi-bin/baz.pl?mode=browse&debug=1
-Additional parameters may be also be specified:
+Note that additional parameters are seperated by '&' rather than
+simply '&'. This is the correct behaviour for HTML pages but is,
+unfortunately, incorrect when creating URLs that do not need to be
+encoded safely for HTML. This is likely to be corrected in a future
+version of the plugin (most probably with TT3). In the mean time, you
+can set C<$Template::Plugin::URL::JOINT> to C<&> to get the correct
+behaviour.
+Additional parameters may be also be specified to the URL:
+
[% url(mode='submit', id='wiz') %]
Which, for the same three examples, produces:
@@ -63,7 +71,6 @@
/cgi-bin/waz.pl?mode=browse&test=1
/cgi-bin/waz.pl?mode=browse&debug=1&test=1
-
The ordering of the parameters is non-deterministic due to fact that
Perl's hashes themselves are unordered. This isn't a problem as the
ordering of CGI parameters is insignificant (to the best of my knowledge).
@@ -77,18 +84,10 @@
/cgi-bin/woz.pl?name=Elrich%20von%20Benjy%20d%27Weiro
-Alternate name may be provided for the plugin at construction time
+An alternate name may be provided for the plugin at construction time
as per regular Template Toolkit syntax.
[% USE mycgi = url('cgi-bin/min.pl') %]
[% mycgi(debug=1) %]
-
-Note that in the following line, additional parameters are seperated
-by '&', while common usage on the Web is to just use '&'. '&'
-is actually the Right Way to do it. See this URL for more information:
-http://ppewww.ph.gla.ac.uk/~flavell/www/formgetbyurl.html
-
- /cgi-bin/waz.pl?mode=browse&debug=1&test=1
-