> -----Original Message----- > From: Andy Wardley [mailto:[EMAIL PROTECTED] On Behalf Of Andy Wardley > Sent: Monday, August 22, 2005 1:08 PM > To: Dave Cash > Cc: Garrett, Philip (MAN-Corporate); '[email protected] ' > Subject: Re: [Templates] Cleanly redirect from Apache::Template? > > Dave Cash wrote: > > The RETURN directive will tell a template to stop processing. > > Although that will only return from the current template. Any parent > template that called it (e.g. via INCLUDE, PROCESS, etc.) will continue. > > The STOP directive will tell all templates to stop processing and > immediately return.
Ah, nice to know. > But I think Perrin's right. This is usally the kind of thing you > usually want to handle outside your templates. I agree. This logic is actually happening inside a module, called from the template. Inverse, I know. What I'm actually attempting to accomplish is to require (cookie-based) site login on some pages and not on others. I would prefer the pages to all have the same extension, and they can't really be separated by directory. That pretty much precludes Apache handling the Authentication without a custom handler. I understand that it blurs the line between view and controller, but I had hoped to simply put [% CALL require_auth %] at the top of those pages. That seems much simpler than integrating a framework or keeping a registry script around for each page. > Apache::Template provides a simple skeleton of a typical mod_perl/TT > application. You're definately encouraged to use it as the basis of > your own, more specialised handler and tweak the bits as you need to. I did attempt to subclass Apache::Template, but it seemed to break the TT2Foo apache configuration parameters. I must have done something wrong. > The Badger Book has a chapter all about this kind of stuff. The > example starting on page 512 illustrates one simple way to handle > redirects. Ok, I'll look. Many thanks for everyone's help. Philip _______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates
