fenom/sandbox/fenom.php

77 lines
1.8 KiB
PHP
Raw Normal View History

2013-07-22 18:03:43 +04:00
<?php
2014-11-05 16:07:50 +03:00
require_once __DIR__.'/../src/Fenom.php';
require_once __DIR__.'/../tests/tools.php';
2013-08-11 19:55:30 +04:00
2014-11-05 16:07:50 +03:00
\Fenom::registerAutoload();
2014-04-17 23:50:18 +04:00
2016-08-27 22:30:34 +03:00
$vars = [
[
"id" => 1,
"name" => "Блаблабла",
"hidden_url" => "/"
],
[
"id" => 2,
"name" => "Каталог",
"hidden_url" => "/catalog"
],
[
"id" => 3,
"name" => "Сыромолочная группа",
"hidden_url" => "/catalog/cat_1.html"
],
[
"id" => 4,
"name" => "Сыры",
"hidden_url" => "/catalog/cat_2.html"
],
];
2016-08-22 17:08:47 +03:00
$fenom = Fenom::factory(__DIR__.'/templates', __DIR__.'/compiled');
$fenom->setOptions(Fenom::AUTO_RELOAD | Fenom::FORCE_VERIFY);
//var_dump($fenom->compile("nested.tpl", [])->getTemplateCode());
//exit;
2016-08-27 22:30:34 +03:00
var_dump($fenom->fetch('bug249/bread.tpl', ["arr" => $vars]));
//var_dump($fenom->compile('bug249/bread.tpl', false)->getBody());
2015-06-03 00:13:09 +03:00
//var_dump($fenom->compile("bug158/main.tpl", [])->getTemplateCode());
2015-06-03 11:31:53 +03:00
//var_dump($fenom->display("bug158/main.tpl", []));
2016-08-27 22:30:34 +03:00
// $fenom->getTemplate("problem.tpl");
/*
*
* Array
(
[0] => Array
(
[id] => 1
[name] => Блаблабла
[hidden_url] => /
)
[1] => Array
(
[id] => 2
[name] => Каталог
[hidden_url] => /catalog/
)
[2] => Array
(
[orig_id] => 1
[hidden_url] => /catalog/cat_1.html
[name] => Сыромолочная группа
)
[3] => Array
(
[orig_id] => 2
[hidden_url] => /catalog/cat_2.html
[name] => Сыры
)
[4] => Array
(
[orig_id] => 6
[hidden_url] => /catalog/cat_6.html
[name] => Сыр плавленый
)
)
*/