|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Jo-W Smarty n00b
Joined: 30 Aug 2009 Posts: 1
|
Posted: Sun Aug 30, 2009 6:41 pm Post subject: smarty callbacks |
|
|
Sorry if this is already planned / suggested in some way but a quick search didn't show me anything.
Could you add the tag name to the callbacks smarty makes? This way I can use 1 php function for multiple smarty functions.
Current:
Code: |
$smarty->register_function('abc', 'smarty_function_abc', false);
$smarty->register_function('def', 'smarty_function_def', false);
function smarty_function_abc($params, &$smarty) {
return 'qwerty';
}
function smarty_function_def($params, &$smarty) {
return 'dvorak';
}
|
Suggested:
Code: |
$smarty->register_function('abc', 'smarty_function', false);
$smarty->register_function('def', 'smarty_function', false);
function smarty_function($params, &$smarty, $functionName) {
if ($funtionName === 'abc')
return 'qwerty';
if ($functionName === 'def')
return 'dvorak';
// ...
}
|
Thanks |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|