This is even more simple:
use strict; use warnings; use Mojolicious::Lite; get '/' => sub { my $c = shift; $c->stash( nose => $c->param( 'nose' ) || 'karl' ); $c->render( template => 'nose', format => 'xml' ); }; app->start; __DATA__ @@ nose.xml.ep <?xml version="1.0" encoding="UTF-8"?> <myapp> <nose><%= $nose %></nose> </myapp>
I can understand wanting to retain the method you use to create the XML document itself (better validation), but do you really need those objects?
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: RFC: Mojolicious::Lite and Moo: A Very Basic Application Layout
by jeffa
in thread RFC: Mojolicious::Lite and Moo: A Very Basic Application Layout
by karlgoethebier
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |