| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Using Variable for $lng in Template | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() Hello,
I want to pass a value from PHP to a template to reference a $Lng variable like: $var = 'eml_some_lang_text' in template to display something like {$lng.$var} I know this is incorrect but does anyone know how I might achieve this? Thanks |
|||||||||
#2
|
|||||||||
|
|||||||||
![]() Bump
|
|||||||||
#3
|
|||||||||
|
|||||||||
![]() Would you like to define a text label in your language (Administration area) then use this label in your templates?
__________________
X-Cart Next: Business 5.2 (learning and testing) X-Cart Classic: Gold and Gold Plus 4.7 Lots of Modules and Customizations OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions) You can catch my ideas here: http://ideas.x-cart.com |
|||||||||
#4
|
|||||||
|
|||||||
![]() I'm a little surprised that your approach doesn't work given the cleanup of language substitution in 4.1.x. Double check that eml_some_lang_text is defined in the language the store is set to.
An alternative to your approach is to get the language variable in the PHP code and pass the text to the template: $langtext = func_get_langvar_by_name("eml_some_lang_text")
__________________
Manuka Bay Company X-Cart Version 4.0.19 [Linux] UGG Boots and other fine sheepskin products http://www.snowriver.com |
|||||||
|
#5
|
|||||||||
|
|||||||||
![]() That actually makes the most sense.
Thanks |
|||||||||
|
|||
X-Cart forums © 2001-2020
|