GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DANCER2::CORE::ROLE::TEMPLATE (3)

.ds Aq ’

NAME

Dancer2::Core::Role::Template - Role for template engines

CONTENTS

VERSION

version 0.166001

DESCRIPTION

Any class that consumes this role will be able to be used as a template engine under Dancer2.

In order to implement this role, the consumer <B>mustB> implement the method render. This method will receive three arguments:
$self
$template
$tokens
Any template receives the following tokens, by default:
o perl_version

Current version of perl, effectively $^V.

o dancer_version

Current version of Dancer2, effectively <Dancer2-VERSION>>.

o settings

A hash of the application configuration.

o request

The current request object.

o params

A hash reference of all the parameters.

Currently the equivalent of $request->params.

o vars

The list of request variables, which is what you would get if you called the vars keyword.

o session

The current session data, if a session exists.

ATTRIBUTES

    name

The name of the template engine (e.g.: Simple).

    charset

The charset. The default value is <B>UTF-8B>.

    default_tmpl_ext

The default file extension. If not provided, <B>ttB> is used.

    views

Path to the directory containing the views.

    layout

Path to the directory containing the layouts.

    layout_dir

Relative path to the layout directory.

Default: <B>layoutsB>.

    engine

Contains the engine.

METHODS

    view_pathname($view)

Returns the full path to the requested view.

    layout_pathname($layout)

Returns the full path to the requested layout.

    pathname_exists($pathname)

Returns true if the requested pathname exists. Can be used for either views or layouts:



    $self->pathname_exists( $self->view_pathname( some_view ) );
    $self->pathname_exists( $self->layout_pathname( some_layout ) );



    render_layout($layout, \%tokens, \$content)

Render the layout with the applied tokens

    apply_renderer($view, \%tokens)

    apply_layout($content, \%tokens, \%options)

    process($view, \%tokens, \%options)

METHODS

AUTHOR

Dancer Core Developers

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Alexis Sukrieh.

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

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DANCER2::CORE::ROLE::TEMPLATE (3) 2016-01-22

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.