in reply to RFC: Mojolicious::Lite and Moo: A Very Basic Application Layout

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)
  • Comment on Re: RFC: Mojolicious::Lite and Moo: A Very Basic Application Layout
  • Download Code

Replies are listed 'Best First'.
Re^2: RFC: Mojolicious::Lite and Moo: A Very Basic Application Layout
by karlgoethebier (Abbot) on Aug 05, 2015 at 21:52 UTC

    Thanks jeffa for the cool hint.

    "...do you really need those objects?"

    Who knows ;-)

    But what i really need is something like:

    <myapp> <nose> <row><foo>this</foo><bar>that</bar></row> <row><foo>nose</foo><bar>cuke</bar></row> <!-- and so on --> </nose> </myapp>

    As i wrote: I tried to simplify it as much... :-)

    Update: And i considered to have one role for each route (about 50). Good idea? i don't know yet.

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»