Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Inserting a smarty variable into a smarty variable

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
JoaoCorreia
Smarty n00b


Joined: 03 Jul 2003
Posts: 3
Location: Setúbal, Portugal

PostPosted: Thu Jul 03, 2003 10:45 pm    Post subject: Inserting a smarty variable into a smarty variable Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Jul 04, 2003 8:41 am    Post subject: Reply with quote

http://smarty.php.net/manual/en/language.syntax.quotes.php

have fun
messju
Back to top
View user's profile Send private message Send e-mail Visit poster's website
JoaoCorreia
Smarty n00b


Joined: 03 Jul 2003
Posts: 3
Location: Setúbal, Portugal

PostPosted: Fri Jul 04, 2003 12:45 pm    Post subject: Doesnt work !! Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Jul 04, 2003 1:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP