fenom/tests/resources/actions.php
bzick 1e97857ea8 Mass refactory
Rename project
2013-04-04 10:56:44 +04:00

31 lines
873 B
PHP

<?php
function myMod($str) {
return "(myMod)".$str."(/myMod)";
}
function myFunc($params) {
return "MyFunc:".$params["name"];
}
function myBlockFunc($params, $content) {
return "Block:".$params["name"].':'.trim($content).':Block';
}
function myCompiler(Cytro\Tokenizer $tokenizer, Cytro\Template $tpl) {
$p = $tpl->parseParams($tokenizer);
return 'echo "PHP_VERSION: ".PHP_VERSION." (for ".'.$p["name"].'.")";';
}
function myBlockCompilerOpen(Cytro\Tokenizer $tokenizer, Cytro\Scope $scope) {
return myCompiler($tokenizer, $scope->tpl);
}
function myBlockCompilerClose(Cytro\Tokenizer $tokenizer, Cytro\Scope $scope) {
return 'echo "End of compiler";';
}
function myBlockCompilerTag(Cytro\Tokenizer $tokenizer, Cytro\Scope $scope) {
$p = $scope->tpl->parseParams($tokenizer);
return 'echo "Tag ".'.$p["name"].'." of compiler";';
}