[if count($.server) > 1] server name = [.server.SERVER_NAME] [else] [.server.SERVER_NAME] [/if]
[[ && ]]
if 'id' is empty, id="_id"
[&items _id][_item] ([_id]) = htmlspecialchars:[:_item] = urlencode[::_item]
[/&]
10 (0) = htmlspecialchars—10 = urlencode—10
20 (1) = htmlspecialchars—20 = urlencode—20
ахуеть!<> (2) = htmlspecialchars—ахуеть!<> = urlencode—%D0%B0%D1%85%D1%83%D0%B5%D1%82%D1%8C%21%3C%3E
Simple algo - if user added special function to template engine, it will be executed, else will be executed PHP function
.server.REMOTE_ADDR = [@substr .server.REMOTE_ADDR 4]
.server.REMOTE_ADDR LENGTH = [@strlen .server.REMOTE_ADDR]
...
and PHP CODE: $tpl->add_user_function("strlen",create_function('$x','return "А ВОТ ХУЙ ВАМ!";'));
.server.REMOTE_ADDR = 07.179.240
.server.REMOTE_ADDR LENGTH = А ВОТ ХУЙ ВАМ!
Here used only added functions. Because they take smart params: $this(DudeTpl object), $repeat(second time execution?), $content(block content or false)[, $param1, $param2(block params)]
[#hash md5 $.server.REMOTE_ADDR]
here is test string
[/#]
...
and PHP CODE: $tpl->add_user_function("strlen",create_function('$x','return "А ВОТ ХУЙ ВАМ!";'));