https://github.com/yanick/dancer-template-templatedeclare
Template::Declare wrapper for Dancer
https://github.com/yanick/dancer-template-templatedeclare
Last synced: about 2 months ago
JSON representation
Template::Declare wrapper for Dancer
- Host: GitHub
- URL: https://github.com/yanick/dancer-template-templatedeclare
- Owner: yanick
- License: other
- Created: 2011-08-21T15:04:33.000Z (almost 14 years ago)
- Default Branch: releases
- Last Pushed: 2013-07-05T03:24:25.000Z (almost 12 years ago)
- Last Synced: 2025-02-15T23:41:13.783Z (3 months ago)
- Language: Perl
- Homepage:
- Size: 171 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
NAME
Dancer::Template::TemplateDeclare - Template::Declare wrapper for DancerVERSION
version 0.3.0SYNOPSIS
# 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::TemplateAll 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 ChampouxCOPYRIGHT 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.