On 11/10/06, Mike Friedman <[EMAIL PROTECTED]> wrote:
With Template Toolkit, if you pass your $self object to the template, then
you can just say:
[% self.some_other_run_mode %]
And if you use the CAP::TT plugin, that is automatically done for you,
except the variable is called 'c'.
[% c.some_other_run_mode %]
I am a little leery of calling runmodes like this though. Often
runmodes will have side effects (like updating databases, or
manipulating data somewhere). I try to keep that stuff out of my
templates. Also, by calling a separate runmode, you will most likely
be invoking your templating object again, and rendering an entirely
new template. That can have performance implications.
If I wanted to include the same snippet of info on a page, I would
probably just call an INCLUDE file or MACRO from with in my template.
If this needed some extra data, then I would probably have provided
that data through the tt_params or tt_pre_process methods.
Cheers,
Cees
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]