NAME MojoX::Renderer::IncludeLater - A post processor to defer partial template rendering DESCRIPTION MojoX::Renderer::IncludeLater is a 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 Mojolicious renderer, including Mojolicious::Renderer and Mojolicious::Renderer::Xslate. SYNOPSIS Example 'test' template: % stash('my_var') // 'my_var has not been set' Example page template:

Include later

Include a template immediately

% include "test" # will render 'my_var has not been set'

Include a template later

% include_later "test" # will render 'foo'

Set a value the included template expects

% stash('test' => 'foo') Which will generate the following output:

Include later

Include a template immediately

my_var has not been set

Include a template later

foo

Set a value the included template expects

HELPERS This plugin creates the following Mojolicious helpers: include_later Is identical to "include" but template inclusion happens after the rest of the template has been rendered. HOOKS This plugin hooks into "after_render" to perform deferred template inclusion. SEE ALSO Mojolicious