![]() |
Smarty variable indexed by string question
This is a problem with understanding how smarty works:
I have a variable array $banner_code where $banner_code.$pos returns a string "x_marks_the_spot". This string is then used to identify a variable set in php called $x_marks_the_spot. My question is given only $banner_code.$pos how do I write to the contents of $x_marks_the_spot? **** If only I could code this: {$"{$banner_code.$pos}"="xyz"} |
Re: Smarty variable indexed by string question
{assign var="x_marks_the_spot" value=$banner_code.$pos}
$x_marks_the_spot can now be used in the template. Yes? |
Re: Smarty variable indexed by string question
Quote:
I actually need to be able to write {${$banner_code.$pos}} but nested '{' are only allowed in smarty 3: example It would appear the only way I can achieve what I am looking for is to include a php block or call a smarty pluggin, which I'm not going to do. Thanks David |
All times are GMT -8. The time now is 03:28 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.