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