mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Fix extends with dynamic blocks
This commit is contained in:
@ -45,7 +45,7 @@ class Benchmark {
|
||||
|
||||
public static function cytro($tpl, $data, $double, $message) {
|
||||
|
||||
$cytro = Cytro::factory(__DIR__.'/../templates', __DIR__."/../compile/");
|
||||
$cytro = Cytro::factory(__DIR__.'/../templates', __DIR__."/../compile");
|
||||
|
||||
if($double) {
|
||||
$cytro->fetch($tpl, $data);
|
||||
@ -55,6 +55,27 @@ class Benchmark {
|
||||
printf(self::$t, __FUNCTION__, $message, round(microtime(true)-$start, 4), round(memory_get_peak_usage()/1024/1024, 2));
|
||||
}
|
||||
|
||||
public static function volt($tpl, $data, $double, $message) {
|
||||
$view = new \Phalcon\Mvc\View();
|
||||
//$view->setViewsDir(__DIR__.'/../templates');
|
||||
$volt = new \Phalcon\Mvc\View\Engine\Volt($view);
|
||||
|
||||
|
||||
$volt->setOptions(array(
|
||||
"compiledPath" => __DIR__.'/../compile',
|
||||
"compiledExtension" => __DIR__."/../.compile"
|
||||
));
|
||||
|
||||
if($double) {
|
||||
$volt->render($tpl, $data);
|
||||
}
|
||||
|
||||
$start = microtime(true);
|
||||
var_dump($tpl);
|
||||
$volt->render(__DIR__.'/../templates/'.$tpl, $data);
|
||||
printf(self::$t, __FUNCTION__, $message, round(microtime(true)-$start, 4), round(memory_get_peak_usage()/1024/1024, 2));
|
||||
}
|
||||
|
||||
public static function run($engine, $template, $data, $double, $message) {
|
||||
passthru(sprintf("php -dmemory_limit=512M -dxdebug.max_nesting_level=1024 %s/run.php --engine '%s' --template '%s' --data '%s' --message '%s' %s", __DIR__, $engine, $template, $data, $message, $double ? '--double' : ''));
|
||||
}
|
||||
|
Reference in New Issue
Block a user