- INCLUDE
Template Toolkit include
examples/dancer/template-include/config.yml
--- template: "template_toolkit"
examples/dancer/template-include/app.psgi
package App; use Dancer2; get '/' => sub { return template 'main.tt', { name => 'Perl Dancer', }; }; App->to_app;
examples/dancer/template-include/views/main.tt
[% INCLUDE 'incl/header.tt' %] <h1>main.tt - [% name %]</h1> [% INCLUDE 'incl/footer.tt' %]
examples/dancer/template-include/views/incl/header.tt
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes"> <title>[%- name -%]</title> </head> <body> From header.tt <hr>
examples/dancer/template-include/views/incl/footer.tt
<hr> Footer </body> </html>
- Also include navigation etc.