Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Template::Declare wrapper for Dancer

branch: releases

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 t
Octocat-spinner-32 Build.PL
Octocat-spinner-32 Changes
Octocat-spinner-32 INSTALL
Octocat-spinner-32 LICENSE
Octocat-spinner-32 MANIFEST
Octocat-spinner-32 META.json
Octocat-spinner-32 META.yml
Octocat-spinner-32 README
Octocat-spinner-32 README.mkdn
Octocat-spinner-32 SIGNATURE
README.mkdn

NAME

Dancer::Template::TemplateDeclare - Template::Declare wrapper for Dancer

VERSION

version 0.3.0

SYNOPSIS

# in 'config.yml' template: 'TemplateDeclare'

engines: TemplateDeclare: dispatch_to: - A::Template::Class - Another::Template::Class

# in the app

get '/foo', sub { template 'foo' => { title => 'bar' }; };

DESCRIPTION

This class is an interface between Dancer's template engine abstraction layer and the Template::Declare templating system.

In order to use this engine, set the template to 'TemplateDeclare' in the configuration file:

template: TemplateDeclare

Template::Declare CONFIGURATION

Parameters can also be passed to the Template::Declare interpreter via the configuration file, like so:

engines:
    TemplateDeclare:
        dispatch_to:
            - Some::Template
            - Some::Other::Template

All the dispatch classes are automatically loaded behind the scene.

USING LAYOUTS

If the layout is set to $name, the template /layout/$name will be used and passed via the content argument.

For example, a simple main layout would be:

template '/layout/main' => sub {
    my ( $self, $args ) = @_;

    html {
        body { 
            outs_raw $args->{content} 
        } 
    } 
};

SEE ALSO

Dancer, Template::Declare.

AUTHOR

Yanick Champoux

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Yanick Champoux.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Something went wrong with that request. Please try again.