You are here: Invoking a function that wass passed to smarty « Smarty Templates Posts « IT news, forums, messages
Invoking a function that wass passed to smarty

Posted by Samuel Abels on 07/24/05 12:57

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация