Displaying smarty variables inside smarty variables
I recently revisited this problem and thought I'd share the solution.
Say you're setting up the help/conditions_customers.tpl page. You want the smarty language variable: {$lng.txt_conditions_customer} to contain something like: {$config.Company.location_address} {$config.Company.location_city}, {$config.Company.location_state} {$config.Company.location_zipcode} The trick is, in help/conditions_customers.tpl, instead of using the statement: {$lng.txt_conditions_customer} use: {eval var=$lng.txt_conditions_customer} This will render the smarty variables within the smarty variable {$lng.txt_conditions_customer}. Hope this helps someone, Rubyaryat |
Nice one...moving to FAQ
|
good find :-)
|
Re: Displaying smarty variables inside smarty variables
There's a reason eval is one letter away from evIl
Quote:
Just to note, eval can be an evil function if it is overused, be sure and use such sparingly. It can become a security exploit and even cause excessive cpu cycles on your server end. |
All times are GMT -8. The time now is 03:41 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.