"/" in function-name
| From: | messju mohr | Date: | Tue, 25 Feb 2003 06:39:17 +0000 |
| Subject: | "/" in function-name | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-8169@lists.php.net to get a copy of this message | ||
hello,
i just tried and recognized, that it is fully working to register a
function with a leading slash.
example:
[php:]
function slash1($params, &$smarty) {
echo 'slash1';
}
$smarty->register_function('/slash1', 'slash1');
function slash2($tag_arg, &$smarty) {
return '?>slash2<?php';
}
$smarty->register_compiler_function('/slash2', 'slash2');
[tpl:]
{/slash1}
{/slash2}
[prints:]
slash1
slash2
i don't feel like this is a bug. quite contrary i would like to rely
on this "feature", so that my code won't break on the next update. i
want to register 2 functions {foo} and {/foo} and make them look like
a block.
( no, i don't want to resurrect my compiler-block-functions, they are
history. i think i have something cleaner/easier/more flexible :) but
i don't want to have to touch Smarty[_compiler].class.php for that so
i need a compiler- function called {/foo}. that works great. now... )
comments? opinions?
regards
messju