2013-01-25 18:36:16 +04:00
|
|
|
<?php
|
|
|
|
|
2013-07-29 14:58:14 +04:00
|
|
|
function myMod($str)
|
|
|
|
{
|
|
|
|
return "(myMod)" . $str . "(/myMod)";
|
2013-01-25 18:36:16 +04:00
|
|
|
}
|
|
|
|
|
2013-07-29 14:58:14 +04:00
|
|
|
function myFunc($params)
|
|
|
|
{
|
|
|
|
return "MyFunc:" . $params["name"];
|
2013-01-25 18:36:16 +04:00
|
|
|
}
|
|
|
|
|
2013-07-29 14:58:14 +04:00
|
|
|
function myBlockFunc($params, $content)
|
|
|
|
{
|
|
|
|
return "Block:" . $params["name"] . ':' . trim($content) . ':Block';
|
2013-01-25 18:36:16 +04:00
|
|
|
}
|
|
|
|
|
2014-04-12 01:00:58 +04:00
|
|
|
function myCompiler(Fenom\Tokenizer $tokenizer, Fenom\Tag $tag)
|
2013-07-29 14:58:14 +04:00
|
|
|
{
|
2014-04-12 01:00:58 +04:00
|
|
|
$p = $tag->tpl->parseParams($tokenizer);
|
2013-07-29 14:58:14 +04:00
|
|
|
return 'echo "PHP_VERSION: ".PHP_VERSION." (for ".' . $p["name"] . '.")";';
|
2013-01-25 18:36:16 +04:00
|
|
|
}
|
|
|
|
|
2013-07-29 14:58:14 +04:00
|
|
|
function myBlockCompilerOpen(Fenom\Tokenizer $tokenizer, Fenom\Scope $scope)
|
|
|
|
{
|
2014-04-12 01:00:58 +04:00
|
|
|
$p = $scope->tpl->parseParams($tokenizer);
|
|
|
|
return 'echo "PHP_VERSION: ".PHP_VERSION." (for ".' . $p["name"] . '.")";';
|
2013-01-25 18:36:16 +04:00
|
|
|
}
|
|
|
|
|
2013-07-29 14:58:14 +04:00
|
|
|
function myBlockCompilerClose(Fenom\Tokenizer $tokenizer, Fenom\Scope $scope)
|
|
|
|
{
|
2013-01-25 18:36:16 +04:00
|
|
|
return 'echo "End of compiler";';
|
|
|
|
}
|
|
|
|
|
2013-07-29 14:58:14 +04:00
|
|
|
function myBlockCompilerTag(Fenom\Tokenizer $tokenizer, Fenom\Scope $scope)
|
|
|
|
{
|
2013-01-25 18:36:16 +04:00
|
|
|
$p = $scope->tpl->parseParams($tokenizer);
|
2013-07-29 14:58:14 +04:00
|
|
|
return 'echo "Tag ".' . $p["name"] . '." of compiler";';
|
2013-01-25 18:36:16 +04:00
|
|
|
}
|