On Monday, November 10, Brian Duggan wrote: 
> On Monday, November 10, sri wrote: 
> > >
> > >     use Mojolicious::Lite; 
> > >     use experimental 'signatures'; 
> > >
> > >     get '/hello/:name' => sub ($c,$name) { $c->render(text => "hi, 
> > > $name") 
> > > }; 
> > >
> > 
> > You can totally do that with a plugin, just use an around_action hook.
> > 
> >     http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Hooks
> 
> Cool!
> 
> https://github.com/bduggan/Mojolicious-Plugin-AutoParams/blob/master/lib/Mojolicious/Plugin/AutoParams.pm

Actually, I guess a much simpler version is possible :

  hook around_action => sub ($n,$c,$a,$l) {
      $c->$a(map $c->stash($_), $c->match->endpoint->pattern->placeholders->@*);
  };

Brian

-- 
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