So, in order to make sure that the before_render hook also gets called,
I should replace my $c->$action in my code with $next->() ?
If that's so, then it begins to make sense.
- Alex
On 03/23/2014 11:26 PM, Glen wrote:
Yes, $next->() calls whatever is next in the chain, which in your
example, is the get route.
It's effectively the same as calling $action->($c).
On Sat, Mar 22, 2014 at 12:01 PM, Alexander Karelas
<[email protected] <mailto:[email protected]>> wrote:
I'd also like to ask: in which cases should I want to (or not want
to) call $next->() ?
It's just that intuitively, I think that around_action should be
the only place where action is called.
- Alex
On 03/22/2014 07:57 PM, Alexander Karelas wrote:
I am baffled as to why this example Lite application works. As
you can see, I have commented out $c->$action from the
around_action handler, yet the page renders fine.
http://pastebin.com/xtxXQAWG (you can try it out in
http://liveperl.us/)
This happens only when there's a call to $next->() inside
around_action.
The reason it baffles me, is because Mojo's documentation says
$next->() forwards to the next hook. Is the next hook
something that will call $self->render(...) once again?
I'm asking because essentially the same structure is used in
the sites I'm developing, so if we solve this pastebin
problem, it will solve the problem on my sites too.
Am I doing something wrong here?
Thanks a lot,
- Alex
--
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]
<mailto:mojolicious%[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://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 http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.