feat: Поддержка psr4. Кеширование шаблона
This commit is contained in:
parent
825641813b
commit
0c30dc230d
9 changed files with 71 additions and 61 deletions
|
|
@ -1,34 +1,34 @@
|
|||
<?php
|
||||
|
||||
require_once '../Klein.php';
|
||||
use ctiso\Klein;
|
||||
|
||||
$data = [
|
||||
[
|
||||
'id' => 0,
|
||||
'id_table' => 0,
|
||||
'name' => '',
|
||||
'header' => 'Наименование муниципального образования',
|
||||
'comment' => '',
|
||||
'colspan' => 0,
|
||||
'rowspan' => 4,
|
||||
'row' => 0,
|
||||
'position' => 0,
|
||||
'type' => '',
|
||||
],
|
||||
[
|
||||
'id' => 1,
|
||||
'id_table' => 0,
|
||||
[
|
||||
'id' => 0,
|
||||
'id_table' => 0,
|
||||
'name' => '',
|
||||
'header' => '',
|
||||
'comment' => 'Над строкой - Прибыло всего (взрослых и детей)',
|
||||
'rowspan' => 0,
|
||||
'row' => 0,
|
||||
'position' => 1,
|
||||
'type' => '',
|
||||
'header' => 'Header #1',
|
||||
'comment' => '',
|
||||
'colspan' => 0,
|
||||
'rowspan' => 4,
|
||||
'row' => 0,
|
||||
'position' => 0,
|
||||
'type' => '',
|
||||
],
|
||||
[
|
||||
'id' => 1,
|
||||
'id_table' => 0,
|
||||
'name' => '',
|
||||
'header' => '',
|
||||
'comment' => 'Header #2',
|
||||
'rowspan' => 0,
|
||||
'row' => 0,
|
||||
'position' => 1,
|
||||
'type' => '',
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
require_once '../Klein.php';
|
||||
|
||||
$tpl = new Klein('template2.html');
|
||||
|
||||
echo $tpl->render(['content' => $data]);
|
||||
$tpl = new Klein(__DIR__ . '/cache');
|
||||
echo $tpl->render('template2.html'. ['content' => $data]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue