Template::Provider::Mojo - Use Mojolicious to provide templates
Contents
Bugs
Report any issues on the public bugtracker.
Copyright And License
This software is Copyright (c) 2015 by Dan Book.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
Description
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.
Name
Template::Provider::Mojo - Use Mojolicious to provide templates
See Also
Template, Mojolicious::Renderer, Mojolicious::Plugin::TemplateToolkit
perl v5.36.0 2023-02-24 Template::Provider::Mojo(3pm)
Synopsis
my $app = Mojolicious->new;
$provider = Template::Provider::Mojo->new({MOJO_RENDERER => $app->renderer});
($template, $error) = $provider->fetch($name);
