in reply to Thoughts on converting from HTML::Template to Template Toolkit
If you don't want TT to add whitespace to your output, you can also use the PRE_CHOMP or POST_CHOMP directives when you make your Template object.
My Template (2.802.14) doesn't seem to mind multiple [% END %] directives on the same line. Perhaps something else was going on in your code?
#!/usr/bin/perl use Template; my $tt = Template->new; my $template = <<"HERE"; <a[% IF url %] href="[% url %]"[% END %][% IF active %] class="active" +[% END %]> HERE $tt->process( \$template, { url => 'http://www.example.com', active => 1 } ); $tt->process( \$template, { url => 'http://www.example.com', active => 0 } );
As for ttree, you can specify the config file with the -f switch. Are you playing with an older TT, by any chance?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Thoughts on converting from HTML::Template to Template Toolkit
by Tanktalus (Canon) on Mar 22, 2006 at 19:51 UTC | |
by brian_d_foy (Abbot) on Mar 22, 2006 at 20:11 UTC |