Re: custom functions
| From: | george | Date: | Thu, 21 Feb 2002 20:25:15 +0000 |
| Subject: | Re: custom functions | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2822@lists.php.net to get a copy of this message | ||
Stripped the function back and rewrote part of it, now it works.
Thanks for the help.
George
At 14:16 21/02/2002 -0600, Monte Ohrt wrote:
Ok, it has the right value. So what's the problem? george wrote:This is being passed from the template Array ( [path] => images )George At 13:57 21/02/2002 -0600, Monte Ohrt wrote:use print_r($params) in your function to see what is being passed in, maybe that will help debug what is going wrong. george wrote:it withI am afraid that hasn't cured my problems, I can get it to work if I remove $path from my function and replacereturns images, but"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 itthe andwhen I place it within Smarty.addons and call it from a template$subst('Email.Unsub')chiefmonkey@wisemonkeydesign.co.ukThat'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:echo the value of path it's "Array" ??To unsubscribe send a blank email to$subst('Email.Unsub')Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/--- You are currently subscribed to smarty as: monte@ispi.net To unsubscribe send a blank email to--- You are currently subscribed to smarty as: monte@ispi.net To unsubscribe send a blank email to $subst('Email.Unsub') Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/ -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/-- Monte Ohrt <monte@ispi.net> http://www.ispi.net/