MojoX::Renderer::IncludeLater - A post processor to defer partial template rendering
=head1 DESCRIPTION
L<MojoX::Renderer::IncludeLater> is a L<Mojolicious> plugin which adds support for
deferring rendering of partial templates until the parent template rendering is complete.
For example, this makes it possible to build up data during rendering (e.g. which
input fields are rendered) and then use that data to render an earlier part of a template.
This should work with any L<Mojolicious> renderer, including L<Mojolicious::Renderer> and
L<Mojolicious::Renderer::Xslate>.
=head1 SYNOPSIS
Example 'test' template:
% stash('my_var') // 'my_var has not been set'
Example page template:
<h3>Include later</h3>
<p>Include a template immediately</p>
% include "test" # will render 'my_var has not been set'
<p>Include a template later</p>
% include_later "test" # will render 'foo'
<p>Set a value the included template expects</p>
% stash('test' => 'foo')
Which will generate the following output:
<h3>Include later</h3>
<p>Include a template immediately</p>
my_var has not been set
<p>Include a template later</p>
foo
<p>Set a value the included template expects</p>
=head1 HELPERS
This plugin creates the following L<Mojolicious> helpers:
=head2 include_later
Is identical to C<include> but template inclusion happens after
the rest of the template has been rendered.
=head1 HOOKS
This plugin hooks into C<after_render> to perform deferred template inclusion.