
Dynamic Variable Name In Smarty 2
So I spent the last few days figuring out how to create dynamic variables or variables variable in Smarty 2. If you only have one value the variable name will be {$form.firstname} But I need it to be dynamic like : {$form.firstname1} {$form.firstname2} etc... We name the counter variable as $count. In Smarty 3 you can easily use {$form.firstname_$count} If we loop with section, the could will look like this : {section name=count loop=$whatArrayToLoop} {$form.firstname_$count} {/section} But this thing is not working in Smarty 2. I try to use smarty 3, but when I refresh my browser there are too many errors that I don’t think worth debugging just so I can use dynamic variable.