in reply to Re: Template Toolkit 2 and subroutines
in thread Template Toolkit 2 and subroutines
I'm quite well aware of that, but thanks for reminding anyway ;)
What I want to do is really simple output processing (like substituting for spaces in menus). I think that's something I can safely do in a template -- if not, I'll be happy to hear why before I go too far in a wrong direction :)
I checked merlyn's examples. Here are the results:
Template:--cut here-- [% MACRO tr_test BLOCK %] join ':', @_; [% END %] [% PERL %] $stash->set( 'tr_test_2', sub { join ':', @_ } ); [% END %] 1: [% tr_test( 'test', '1' ) %] 2: [% tr_test_2( 'test', '2' ) %] --cut here--
--cut here-- 1: join ':', @_; 2: test:2 --cut here--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Template Toolkit 2 and subroutines
by merlyn (Sage) on Oct 09, 2001 at 18:27 UTC | |
|
Re: Re: Re: Template Toolkit 2 and subroutines
by davorg (Chancellor) on Oct 09, 2001 at 18:29 UTC | |
|
Re: Re: Re: Template Toolkit 2 and subroutines
by perrin (Chancellor) on Oct 09, 2001 at 18:39 UTC |