in reply to Calling Apache::Template's handler directly

There's not much value in Apache::Template if you are using Registry scripts. It's quite easy to call Template yourself and the configuration stuff is easy too. I'd say it's safer and easier than fussing with internal redirects.

The other approach is to move the Apache::Registry scripts you have into modules that can be called from Apache::Template. There is a hook for calling your own sub that can put things into the stash before the template is called.

  • Comment on Re: Calling Apache::Template's handler directly

Replies are listed 'Best First'.
Re: Re: Calling Apache::Template's handler directly
by bsb (Priest) on Jan 06, 2003 at 03:13 UTC
    Thanks.

    The reason I was trying to stick with A::T is that others will be managing the site day to day and I want them to be able to change the configuration without looking at Perl code. So easy for me is not easy for them.

    I'm using the 2nd approach to setup a user information object for the template. I'll think about putting the other functions in there. It certainly would make param handling easier.

    I like dynamically choosing the template but I guess dynamically including components will do the same.

    You're right to point out that it's starting to get messy though.

      You could actually keep the config inside httpd.conf but do it with PerlSetVar commands that you read in your code.

      I can't tell exactly what you're doing with the user information object, but the approach I was referring to uses the TT2ServiceModule option. You might want to take a look if that's not what you're doing now.

      I completely agree that running some code and then dynamically choosing a template is better, which is why I don't use Apache::Template. It's much easier to do that when you call Template directly.