mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Add #48: allow call static method in templates and allow disable this option
This commit is contained in:
@ -1,13 +1,23 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__.'/../vendor/autoload.php';
|
||||
namespace Ts {
|
||||
class Math {
|
||||
public static function multi($x, $y) {
|
||||
return $x * $y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$fenom = Fenom::factory(__DIR__.'/templates', __DIR__.'/compiled', 0);
|
||||
namespace {
|
||||
require_once __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
$fenom->display("../templates/../fenom.php", array(
|
||||
"user" => array(
|
||||
"name" => "Ivka",
|
||||
$fenom = Fenom::factory(__DIR__.'/templates', __DIR__.'/compiled', Fenom::FORCE_COMPILE);
|
||||
|
||||
$fenom->display("greeting.tpl", array(
|
||||
"user" => array(
|
||||
"name" => "Ivka",
|
||||
'type' => 'new'
|
||||
),
|
||||
'type' => 'new'
|
||||
),
|
||||
'type' => 'new'
|
||||
));
|
||||
));
|
||||
}
|
Reference in New Issue
Block a user