App::TemplateServer::Provider - role that a Provider should consume


App-TemplateServer documentation Contained in the App-TemplateServer distribution.

Index


Code Index:

NAME

Top

App::TemplateServer::Provider - role that a Provider should consume

DESCRIPTION

Top

Template systems are interfaced with App::TemplateServer with this role. The template server will call the methods required by this role to provider its functionality.

REQUIRED METHODS

Top

You need to implement these:

list_templates

Returns a list of strings representing template names.

render_template($template, $context)

Return the rendered text of the template named by $template. If $template can't be rendered, throw an exception. $context is the App::TemplateServer::Context (App::TemplateServer::Context) object for the request.

SEE ALSO

Top

App::TemplateServer::Provider::Filesystem - a role that provides some useful defaults for fs-based templating systems like TT or Mason.

App::TemplateServer::Provider::TT - a TT provider

App::TemplateServer::Provider::Null - a boring example provider

App::TemplateServer


App-TemplateServer documentation Contained in the App-TemplateServer distribution.

package App::TemplateServer::Provider;
use Moose::Role;

has 'docroot' => (
    is         => 'ro',
    isa        => 'ArrayRef[Defined]',
    required   => 1,
    auto_deref => 1,
);

requires 'render_template';
requires 'list_templates';

1;

__END__