Hello,
I want to port CGI scripts generating HTML forms with quite a lot logic to 
EP templates.

What I need is to test EP templates without Mojo::Test, as unit tests.


use Modern::Perl;
use Mojo::Template;
my $mt = Mojo::Template->new;

my $path_prefix = $ENV{'MOJO_HOME'} . '/templates';
my $output = $mt->render_file($path_prefix . '/views/index.html.ep');

say $output;

The problem is that render_file takes arguments as a list. It takes extra 
work to bind variables with arguments passed to templates. 

I have checked 
http://mojolicio.us/perldoc/Mojolicious/Plugin/EPRenderer.txt, which seems 
to be doing it. As a plugin I can't use it standalone.

Any suggestions? Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to