On Mon, 2005-01-03 at 17:39 -0500, Arshavir Grigorian wrote: > >The stash contents should be passed to all templates that you call > >already. That's the default behavior. > > > > > I am not sure what you mean. Could you please explain this a little more?
My assumption is that you have templates which do a PROCESS (or INCLUDE, but don't do that) to call the toolbar template. In that case, the full contents of the stash are passed along to the toolbar template. > In my understanding the 2 options are: > > 1) compute the permissions before every $tt->process call then pass it > to the template in addition to all the data relevant to the template itself. That's the one I'm talking about. I was assuming you have only one $tt->process() call per request. > The info is stored in a Apache::Session::Postgres object, so each page > would have to retrieve the session key from pnotes then use it to > retrieve the permissions data from the above session object. I was > thinking that since it's the same code in all places, that there would > be a way to centralize it in one place (the toolbar) vs scatter it in > every page. I structure my web applications so that common code can be added to all requests in a central place (some kind of common "setup" hook). I usually put my $tt->process inside of some wrapper function as well, since I want it to be a singleton. That's probably where I would handle this. If you haven't structured things in a way that lets you share code easily between requests, I could see why the plugin approach would look more attractive. - Perrin _______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates
