Dancer::Template::TemplateToolkit man page on Pidora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Pidora logo
[printable version]

Dancer::Template::TempUserTContributed PerDancer::Template::TemplateToolkit(3)

NAME
       Dancer::Template::TemplateToolkit - Template Toolkit wrapper for Dancer

DESCRIPTION
       This class is an interface between Dancer's template engine abstraction
       layer and the Template module.

       This template engine is recomended for production purposes, but depends
       on the Template module.

       In order to use this engine, use the template setting:

	   template: template_toolkit

       This can be done in your config.yml file or directly in your app code
       with the set keyword.

       Note that by default,  Dancer configures the Template::Toolkit engine
       to use <% %> brackets instead of its default [% %] brackets.  This can
       be changed within your config file - for example:

	   template: template_toolkit
	   engines:
	       template_toolkit:
		   start_tag: '[%'
		   stop_tag: '%]'

       By default, Template is used, but you can configure Dancer to use a
       subclass with the "subclass" option.

	   engines:
	       template_toolkit:
		   subclass: My::Template

WRAPPER, META variables, SETs
       Dancer already provides a WRAPPER-like ability, which we call a
       "layout". The reason we do not use TT's WRAPPER (which also makes it
       incompatible with it) is because not all template systems support it.
       Actually, most don't.

       However, you might want to use it, and be able to define META variables
       and regular Template::Toolkit variables.

       These few steps will get you there:

       ·   Disable the layout in Dancer

	   You can do this by simply commenting (or removing) the "layout"
	   configuration in the config.yml file.

       ·   Use Template Toolkit template engine

	   Change the configuration of the template to Template Toolkit:

	       # in config.yml
	       template: "template_toolkit"

       ·   Tell the Template Toolkit engine who's your wrapper

	       # in config.yml
	       # ...
	       engines:
		   template_toolkit:
		       WRAPPER: layouts/main.tt

       Done! Everything will work fine out of the box, including variables and
       META variables.

SEE ALSO
       Dancer, Template

AUTHOR
       This module has been written by Alexis Sukrieh

LICENSE
       This module is free software and is released under the same terms as
       Perl itself.

perl v5.14.1			  2011-07-Dancer::Template::TemplateToolkit(3)
[top]

List of man pages available for Pidora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net