http://www.perlmonks.org?node_id=506100


in reply to CGI::Application, Template Toolkit and global parameters

Since you process the main_menu.tmpl, it acts like it is defined in the Template toolkit Manual.

Basically if you 'PROCESS' a template, it can modify the current variable stash, it does not use localization. So it sees and can modify all the variables you "have"(can use) in layout.tmpl in your first example (you pass the variables when you call $self->tt_process() for example in your perl code).

If you want to use it in a constant-like form though, why not just merge menu.def.tmpl and main_menu.tmpl together?
  • Comment on Re: CGI::Application, Template Toolkit and global parameters

Replies are listed 'Best First'.
Re^2: CGI::Application, Template Toolkit and global parameters
by Fang (Pilgrim) on Nov 06, 2005 at 11:55 UTC

    If you want to use it in a constant-like form though, why not just merge menu.def.tmpl and main_menu.tmpl together?

    I guess that is one of those obvious solution you can only react to with "why didn't I think of that sooner?". Thanks for the suggestion.