开发者

Smarty calling a function inside a function

we are required to learn smarty right now. and i am already into creating my own functions h开发者_如何学JAVAow do i call one function inside another function?

smarty seems to call its function like

{function_name param1=val1}

i tried to put it inside the function.myfunction.php but smarty seems to parse { } only inside the .tpl files

is there any way i could call them like

function foo($bar){
 $foo = function2(param1,param2);
 return $foo + $bar;
}


That is pretty much exactly how you would do it. Your functions are written in PHP, so you use php, not smarty, notation to call your functions. You will have to make sure that the function you want to call has been included.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜