marcink has asked for the wisdom of the Perl Monks concerning the following question:
is it possible to define a subroutine within a template? All the examples I've seen so far assume that the template is being processed from a piece of perl code that prepares variables, while I'd prefer to stick with ttree.
What I'm looking for is some kind of tt2 equivalent of named PERL blocks that are planned for tt3:
[% PERL my_own_func %] ..function code.. [% END %] [% my_own_func(args) %]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Template Toolkit 2 and subroutines
by merlyn (Sage) on Oct 09, 2001 at 17:51 UTC | |
|
Re: Template Toolkit 2 and subroutines
by perrin (Chancellor) on Oct 09, 2001 at 17:54 UTC | |
by marcink (Monk) on Oct 09, 2001 at 18:12 UTC | |
by merlyn (Sage) on Oct 09, 2001 at 18:27 UTC | |
by davorg (Chancellor) on Oct 09, 2001 at 18:29 UTC | |
by perrin (Chancellor) on Oct 09, 2001 at 18:39 UTC |