Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Template Toolkit layout

---
template: "template_toolkit"
layout:   "general.tt"
package App;
use Dancer2;


get '/' => sub {
    return template 'main.tt', {
        title => 'Perl Dancer',
    };
};

App->to_app;
<h1>[% title %]</h1>

<h2>Hello Dancer</h2>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
  <title>[% title %]</title>
</head>
<body>
From layout
<hr>
[% content %]
<hr>
Welcome to the main layout.
</body>
</html>