| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Smarty variable indexed by string question | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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"}
__________________
X-Cart GOLD Plus v4.5.4 CDSEO Pro ewdhosting Dedicated Server Dedicated SSL Stone Edge OM |
|||||||
#2
|
|||||||
|
|||||||
![]() {assign var="x_marks_the_spot" value=$banner_code.$pos}
$x_marks_the_spot can now be used in the template. Yes?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#3
|
|||||||
|
|||||||
![]() 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
__________________
X-Cart GOLD Plus v4.5.4 CDSEO Pro ewdhosting Dedicated Server Dedicated SSL Stone Edge OM |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|