Hello,

I've been using HTML::Template for a while, but am having a weird problem when 
using it in a CGI::Application app.  Basically, when I call 
$template->output, the application requests the page from the server twice, 
instead of once if I just create and return my own HMTL.

CGI::Application is based around run modes, where calling 
http://localhost/myapp?rm=myrun  will send you to a method in a class derived 
from CGI::Application.  In the method I'm just getting some stuff from a 
database table, creating the template like this:

$self->load_tmpl($template_file, case_sensitive => 1);

and sending it back like this:
return $template->output; # for CGI::Application

or this:
$self->page = $template->output; # for CGI::Application::Plus

This is running under Apache 2.0.50 and mod_perl; HTML::Template 2.7; I've 
tried it under CGI::Application 1.30, CGI::Application::Plus 1.14, and 
CGI::Builder::CgiAppAPI v. 1.24  (all of these do basically the same thing).

If  I comment out the $template->output() call, the problem goes away: 
clicking on a like to the run-mode in question results in one call to that 
mode (but with no output); restoring the output() call results in two calls 
to the run mode.

I've been reading various man pages but I'm still baffled.  Anyone have an 
suggestions?

Thanks for any help,
Dan


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to