Invoking a function that wass passed to smarty
| From: | Samuel Abels | Date: | Sun, 24 Jul 2005 09:57:12 +0000 |
| Subject: | Invoking a function that wass passed to smarty | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-12828@lists.php.net to get a copy of this message | ||
Hello,
I am trying to invoke a PHP function inside a smarty template:
test.php:
------
function myfunction($arg) { echo $arg }
$smarty->assign('myfunction', myfunction);
------
test.tmpl:
------
{$myfunction("Test")}
------
Smarty error: [in test.tmpl line 1]: syntax error: unrecognized tag:
$lang("Test") (Smarty_Compiler.class.php, line 436)
in /home/www/web222/html/debain.org-step2/tefinch/smarty/Smarty.class.php on line 1088
I also tried playing around with the syntax in the template a bit, but
to no avail. Is there a way to do this?
Thanks,
-Samuel