https://metacpan.org/pod/Mojolicious::Guides::Routing#Route-to-callback

On Fri, Aug 12, 2016 at 3:08 PM, Randall Sindlinger <[email protected]>
wrote:

> Hi,
>
> I'm working on code that I inherited, and I've hit something that is
> opaque to me.
>
> What does this code snip in setup() intend to do, specifically regarding
> the hash key 'cb'?
>
>       my $authed = $r->under("/$path_base")->to(cb => sub {
>               my $c = shift;
>               return $c->deny_auth unless $c->auth && $c->authz(role =>
> 'update');
>               return 1;
>           })->name("authed_select_$name");
>       $authed->post->to("$cname#create")->name("create_$name");
>
>
> The documentation on to()
> <http://mojolicious.org/perldoc/Mojolicious/Routes/Route#to> doesn't seem
> to help here.
>
> I see some references to a $cb value in the bowels of the mojilicious code
> base, so I'm guessing it's reaching inside to affect behavour somewhere;
> furthermore, I don't see the hash key cb being used anywhere in the code;
> only being set during the app setup().
>
> The full code context is at https://github.com/USGCRP/
> gcis/blob/master/lib/Tuba.pm#L259 , if that's helpful.
>
> Thanks in advance for any insights,
> -Randall
>
>
> --
> 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 https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to