At 2014-09-02 09:18:19 -0700, [email protected] wrote:
>
> So you recommend separated get || post methods for each request like:
>
> $r->get('/')->to('home#index');
> > $r->get('/photos')->to('photos#index');
> > $r->get('/blogs')->to('blogs#index');
> >
>
> Right ?
Remember that you can do things like:
foreach (qw(a b c)) {
$r->get("/$_")->to("${_}#index");
$r->post("/$_")->to("${_}#save");
}
> If so, how simple task like change language woul be accomplish in
> mojo.
Use a bridge. Something like:
$lang = $r->bridge->to(cb => sub { …set stash('lang')… });
$lang->get('/foo')->to('what#ever');
And then you can consult stash('lang') in What::ever.
-- ams
--
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.