Comment example

[* it is comment]
...

Condition example

                [if count($.server) > 1]
                        server name = [.server.SERVER_NAME]
                [else]
                        [.server.SERVER_NAME]
                [/if]
        
server name = helldude.ru

Delimiters escaping

                [[ && ]]
        
[ && ]

ForEach block + htmlspecialchars(:) + urlencode(::)

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

Function test

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 = 241.237.238

.server.REMOTE_ADDR LENGTH = А ВОТ ХУЙ ВАМ!

Block function test

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 "А ВОТ ХУЙ ВАМ!";'));
        
d8c7c2aa98ca1cbcf589a68e68123ac2 e42dc8a1e69d8b1e5355d424380e66bc41eb9cf2
Generation time — 0.045819044113159 Яндекс.Метрика