| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How to include Smarty variable into path to file | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() Dear friends,
I have a custom smarty variable in my '$page_data' array called '$page_data.pagemenu' The value of '$page_data.pagemenu' is the text 'pagemenu.tpl'. If I write the following in my templates {$page_data.pagemenu} I obtain the text 'pagemenu.tpl' written, which is OK. The problem is that I need to use '$page_data.pagemenu' to include a file this way: {include file="path/to/{$page_data.pagemenu}" } Doing this I try to include the following file: {include file="path/to/pagemenu.tpl"} I don╢t Know why but I allways obtain an smarty error and I have tried a lot of different sintaxes with no luck. Can you please help me?
__________________
X-Cart 4.1.5 PHP 4.3.9 Mysql 4.1 VPS CentOS 4.2 Mods: Too much... * Moving to 4.1.8 and to a dedicated server * |
|||||||||
#2
|
|||||||
|
|||||||
![]() use back quotes to evaluate like in unix/linux ('':literal, "":expression, ``:evaluate)
ie: {include file="path/to/`$page_data.pagemenu`" } |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|