Re: custom functions
| From: | george | Date: | Thu, 21 Feb 2002 19:53:54 +0000 |
| Subject: | Re: custom functions | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2817@lists.php.net to get a copy of this message | ||
I am afraid that hasn't cured my problems,
I can get it to work if I remove $path from my function and replace it with "images" which is the directory where the images are stored.
but {getimage path="images"} doesn't work
George
At 11:17 21/02/2002 +0100, Ivo Jansch wrote:
Hi, george wrote:getimage("images") and echo the value of $path it returns images, but when I place it within Smarty.addons and call it from a template the and echo the value of path it's "Array" ??That's because of the way Smarty passes params to you. If your function is normally this: function func_getimage($path) { // lalalalala... } then when using it in smarty, change it to this: function smarty_func_getimage($params) { $path = $params["path"]; // lalalalalala } then it should work. Greetings, Ivo -- Ivo Jansch <ivo@ibuildings.nl> ibuildings.nl BV - information technology http://www.ibuildings.nl --- You are currently subscribed to smarty as: chiefmonkey@wisemonkeydesign.co.uk To unsubscribe send a blank email to $subst('Email.Unsub') Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/