News

Variables

2013-10-23 08:03

It is possible to use variables

Use case

layout 'site':

<html>
  <head>
    <title>[% $title %]</title>
  </head>
  <body>
    [% yield %]
  </body>
</html>

page '/':

[% $title = 'Home Page' %]
[% layout 'site' %]
<div>This is home</div>

page 'about':

[% $title = 'About us' %]
[% layout 'site' %]
<div>This is about us page</div>