Hi,
I think you are looking at the problem from the wrong angle. When you use a template, you dont wanna know where your data comes from. You just want to take a template, set it the values it depends on (which can be strings, numbers or an object) and run it. It doesnt matter if it comes from a _GET array or from a database query. Because thats the kind of separation you want.
So if you have a $_GET["site"] value you want to access, you can just set it to your template like
Code:
$myTemplate->->assign('site', $_GET['site']);
What I am not very clear about is the function thing. I know you can build your own smarty tags or smarty functions but I am not sure if I would want to call a function from MY application. Of course it is valid and it can be good
I think that I would want to call a function only if it has to do with presentation and no with the logic of my domain. Perhaps if you give me an example, I could say more (of course, its just my subjective opinion hehehehe)
As regard of assigning variables in a template and the accessing them from PHP, I think its a bad idea (perhaps you are mixing the ideas). I first think, why would he want to assing a variable in a template and then accessing from a PHP file? My answer is: he worked some logic in the template and needs it back in his PHP script. If thats the case, then you are not using it properly. The idea of a template is to separate the presentation logic, of the bussiness logic. Perhaps my assumptions were wrong, in that case, my idea is still valid but doesnt apply to your case hahaha
But if I got it wrong, perhaps you can explain me a bit more what you want to do (and why) with your smarty variables and I might be able to help you out
Cheers!
PS: I also like Smarty!