feat: Поддержка psr4. Кеширование шаблона

This commit is contained in:
origami11@yandex.ru 2025-05-21 15:50:17 +03:00
parent 825641813b
commit 0c30dc230d
9 changed files with 71 additions and 61 deletions

View file

@ -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'=> [