简体   繁体   中英

Smarty calling a function inside a function

we are required to learn smarty right now. and i am already into creating my own functions how 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM