[Dancer-users] bug with multiple "template" calls ?

Assaf Gordon gordon at cshl.edu
Thu Dec 15 20:18:43 CET 2011


Hello,

In my dancer application, I'm using "template" to create documents that are not necessarily displayed as HTML (they are message bodies that will be sent with Dancer::Plugin::Email).

I have one (or more) calls to "template" to create the email text.
and the last "template" creates the HTML page.


Conceptual example:
====
get "/hello" => sub {
	my $name = params->{name};
	my $email = params->{email};
	
	## Email to be sent to the user, NOT rendered as HTML.
	my $msg = template("email_body", { name => $name }, { layout => undef } ) ;
	my $subject = template("email_subject", { name => $name }, { layout => undef } ) ;
	email { message => $msg, 
                subject => $subject,
                to => $email } ;

	## The welcome page, sent back to the user
	return template("welcome", { name => $name, email => $email } ) ;
}
=====

With Dancer version 1.3079_3, it worked perfectly.
After upgrading to 1.3090, the result of the first template is always returned to the user - what changed ? any ideas/suggestions are welcomed.

Thanks,
 -gordon


More information about the Dancer-users mailing list