smarty.get no longer working
I have some old php code th开发者_如何学Cat has been working happily. I need to do some updating and have moved the code to another machine. Everything is fine except this smarty code no longer works.
{$smarty.get.myvar}
I know it must be to do with differnt config settings but i can't figure it out. Register_Globals is off on both installations.
This is a BAD way of working with request variables. Template should never fetch the variables directly from GPC vars. Variables should be validated by script, sanitized and then ->assigned to a template.
The documentation for the "global" variables is here http://www.smarty.net/manual/en/language.variables.smarty.php
Make sure you have request_vars_order
and request_use_auto_globals
configured to your needs, but the syntax $smarty.get.myvar
is completely fine.
Make sure the case is correct and you are not sending $smarty.get.myVar
...
Try to use this option:
{$smarty.get['myvar']}
I had this issue, and with this syntax it works
精彩评论