What is equivalent to TT RETURN directive in Mojolicious renderer?

There is a directive in the Template Toolkit RETURNthat can be used to stop processing the current template and return to the template from which it was called. How can I do this in Mojolicious?

+3
source share
1 answer

Based on the documentation, they say that templates work the same way as Perl submarines (in fact, they are compiled into Perl sub internally). I did some experiments. It seems that simple

% return;

returns a template discarding all its output. AND

% return $_M;

returns from the template and saves all its output data before the return statement.

, . Mojolicious internals,

% use Data::Dumper; return Dumper $self;

, .

+1

All Articles