-
Notifications
You must be signed in to change notification settings - Fork 0
Hot to use
riaf edited this page Dec 26, 2010
·
1 revision
<?php
require_once 'LightningTemplate.php';
$items = array(
'hoge', null, '<b>fuga</b>', 0, 'piyo', '',
);
$lt = new LightningTemplate('sample.html');
$lt->title = 'Sample Template';
$lt->name = 'World';
$lt->message = '<b>hi!</b>';
$lt->items = $items;
echo $lt;
<?php
require_once 'LightningTemplate.php';
$items = array(
'hoge', null, '<b>fuga</b>', 0, 'piyo', '',
);
$lt = new LightningTemplate(
'sample.html',
new LightningTemplateCache_File('./cache')
);
$lt->title = 'Sample Template';
$lt->name = 'World';
$lt->message = '<b>hi!</b>';
$lt->items = $items;
echo $lt;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>{{ title }}</title>
</head>
<body>
<h1>{{ title }}</h1>
<p>Hello {{ name }}</p>
<p>{{ message|safe }}</p>
<h2>Items</h2>
<ul>
{% for item in items %}
{% if item %}
<li>{{ item }}</li>
{% endif %}
{% endfor %}
</ul>
</body>
</html>