[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] load_tmpl() question.


I hate to be picky, but if we're all overriding it anyway, then why shouldn't it just stay the way it is? Having it give a simple default for people who are just starting seems reasonable. (Although I can see why people who don't use H::T might want to remove the dependency.) When I started learning CGI::Application, I hadn't picked a templating system yet and that would have just been one more thing to decide and learn.

And for a fun addition ... Why did I override load_tmpl?
- I use HTML::Template::Expr instead
- I split my templates into header, footer, and content, so I needed to use a filehandle

I then created a separate display() method that loads the template, makes sure that my session ID and a few other global variables are in it, and returns the output of the template. So when I have a runmode that ends by showing a page using the content template 'options.tmpl', I just return $self->display('options').

Jaclyn


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.