PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I think you can call the function by using the function name directly, can't you. I have done this, accidentally, in TemplateLite, which is based on the Smarty codebase.
but I need to return a value from the function based on parameters I send to it (this is the second function mind you (get_elementlink)). With that value, I need to pass it to my primary function (the main one I'm calling).
but with smarty it's a little tougher, I know I need to use the assign function, just not sure how to have the 'value' parameter be dynamically assigned:
you can definitely assign variables at runtime using {assign var="myvar" value="myvalue"} and you can definitely call functions using {myneatfunction param="somevalue" param2="some other value"}.
I don't see why you shouldn't be able to put the two together...I just don't know how.
When you call the function, can you read it into a var? If you can, call the function and read it into a var, then read that var into the other var.
----------
That didn't really even make sense to me, but I had to throw it out there. That little voice in my head was taunting me to 'Be a man, do it!'. So I did it.
//returnes result where function is called
{DoSomeStuff param1='somevariable' param2 = 'someotherparam'}
//returnes result in a variable for further usage
{DoSomeStuff param1='somevariable' param2 = 'someotherparam' assign='output'}
...code using {$output}