|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
JoaoCorreia Smarty n00b
Joined: 03 Jul 2003 Posts: 3 Location: Setúbal, Portugal
|
Posted: Thu Jul 03, 2003 10:45 pm Post subject: Inserting a smarty variable into a smarty variable |
|
|
Howdy,
In PHP we can do:
$var1 = "Testing 123 ".$var2." etc etc";
How can we do this with smarty ?
I have an object but I would like to put in p1 a smarty variable. How can I do this ?
{area->list p1='<a href=$url><img src=/home/images/$img_on border=0></a>' p2='1' p3=''} |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
|
Back to top |
|
JoaoCorreia Smarty n00b
Joined: 03 Jul 2003 Posts: 3 Location: Setúbal, Portugal
|
Posted: Fri Jul 04, 2003 12:45 pm Post subject: Doesnt work !! |
|
|
The following code doesnt work !
{area->lista p1='<a href=$url><img src=/`$area_path`/images/$img_on border=0></a>' p2='1' p3=''}
$area_path is not working, it stays blank and the var is ok because it works with other simpler code ( {$area_path} )
Notice I put '' not "", my p1 is beeing parsed with eval in the object. If I put "" it doesnt work
Thanks in advance
Joao Correia |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Jul 04, 2003 1:44 pm Post subject: |
|
|
no it doesn't. as the docs say:
"Smarty will recognize assigned variables embedded in double quotes so long as..."
not in single quotes, as you use. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|