feat: Поддержка psr4. Кеширование шаблона
This commit is contained in:
parent
825641813b
commit
0c30dc230d
9 changed files with 71 additions and 61 deletions
|
|
@ -1,12 +1,13 @@
|
|||
<?php
|
||||
|
||||
require_once '../Klein.php';
|
||||
use ctiso\Klein;
|
||||
|
||||
function title($x) {
|
||||
return ucfirst($x);
|
||||
}
|
||||
|
||||
$tpl = new Klein('template.html');
|
||||
$tpl = new Klein(__DIR__ . '/cache');
|
||||
|
||||
$u1 = new stdClass();
|
||||
$u1->name = 'Paul';
|
||||
|
|
@ -20,7 +21,7 @@ $u3 = new stdClass();
|
|||
$u3->name = 'Jane';
|
||||
$u3->age = 12;
|
||||
|
||||
echo $tpl->render([
|
||||
echo $tpl->render('template.html', [
|
||||
'pagename' => 'awesome people',
|
||||
'authors' => [$u1, $u2, $u3],
|
||||
'city'=> [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue