06 Jun 2021 17:32:08 UTC
- Distribution: Dancer2
- Module version: 0.301004
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Issues (122)
- Testers (770 / 3 / 0)
- KwaliteeBus factor: 3
- 84.81% Coverage
- License: perl_5
- Activity24 month
- Download (391.12KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:78 non-PAUSE usersCROMEDOME Jason A. Cromeand 1 contributors
- Dancer Core Developers
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- COPYRIGHT AND LICENSE
Dancer2::Core::Role::Template - Role for template engines
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 must implement the method
render. This method will receive three arguments:
Any template receives the following tokens, by default:
Current version of perl, effectively
Current version of Dancer2, effectively
A hash of the application configuration.
The current request object.
A hash reference of all the parameters.
Currently the equivalent of
The list of request variables, which is what you would get if you called the
The current session data, if a session exists.
The name of the template engine (e.g.: Simple).
The charset. The default value is UTF-8.
The default file extension. If not provided, tt is used.
Path to the directory containing the views.
Path to the directory containing the layouts.
Relative path to the layout directory.
Contains the engine.
Returns the full path to the requested view.
Returns the full path to the requested layout.
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 the layout with the applied tokens
Dancer Core Developers
This software is copyright (c) 2021 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.