Template::Provider::Mojo(3pm)

Template::Provider::Mojo3pm

Use mojolicious to provide templates

Usage

 my $app = Mojolicious->new;
 $provider = Template::Provider::Mojo->new({MOJO_RENDERER => $app->renderer});
 
 ($template, $error) = $provider->fetch($name);

Overview

Template::Provider::Mojo is a Template::Provider subclass that uses a Mojolicious::Renderer instance to resolve template names. This means that "paths" in Mojolicious::Renderer will be searched for file-based templates, and "classes" in Mojolicious::Renderer will be searched for DATA templates. The "ENCODING" configuration setting will be initialized to "encoding" in Mojolicious::Renderer if unset.

Methods

Template::Provider::Mojo inherits all methods from Template::Provider and implements the following new ones.

fetch

Returns a compiled template for the name specified. See "fetch($name)" in Template::Provider for usage details.

load

Loads a template without parsing or compiling it. This is used by the INSERT directive.

Bugs

Report any issues on the public bugtracker.

Author

Dan Book <[email protected]>

From libmojolicious-plugin-templatetoolkit-perl 0.006-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.