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

Variable in a variable or nested variables

 
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
mpk
Smarty Rookie


Joined: 26 Jun 2003
Posts: 9
Location: Amsterdam, Netherlands

PostPosted: Thu Jun 26, 2003 9:57 am    Post subject: Variable in a variable or nested variables Reply with quote

Hi,
My problem is the following: I want to include a variable in another variable and to be more specific I want to pass variables to the overlib function.
My code tries to do something like this:
{popup caption="Details" text="{$myvar}" snapx=10 snapy=10}.
But this won't work because it stops at the first right delimiter.
Is there anyway to do this? I searched the forum, but have found no answer yet.

Thanks.-
Back to top
View user's profile Send private message Send e-mail
mischa
Smarty Rookie


Joined: 30 Apr 2003
Posts: 19
Location: Suhr, Switzerland

PostPosted: Thu Jun 26, 2003 12:52 pm    Post subject: Reply with quote

Hi

try this:

Code:
{popup caption="Details" text=$myvar snapx=10 snapy=10}


PS: have a look at domTT
http://www.mojavelinux.com/forum/viewtopic.php?t=127
i've done a smarty-function too. first i've tried it with overlib, but it had some problems on several browsers. domTT works better for me.
Back to top
View user's profile Send private message
mpk
Smarty Rookie


Joined: 26 Jun 2003
Posts: 9
Location: Amsterdam, Netherlands

PostPosted: Thu Jun 26, 2003 2:16 pm    Post subject: Reply with quote

Many thanks. It works!
I'm very impressed from domTT. Is your function public?
Back to top
View user's profile Send private message Send e-mail
stefano
Smarty n00b


Joined: 28 Jun 2003
Posts: 2

PostPosted: Sat Jun 28, 2003 1:01 am    Post subject: Problem with array variables in popup Reply with quote

Obliquid, our open source PHP/XML framework, was using Smarty 2.3.0. Today I decided to upgrade CVS version to Smarty 2.5.0, but a problem arose.

I was getting elements from array variables inside overlib popups with this syntax:

Code:
{{popup text="$msg[edit]"}}


Now it doesn't work anymore. I tried $msg.edit, but doesn't work either.

Any suggestions?

Thankyou
Stefano
_________________
http://dev.obliquid.com/
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Jul 02, 2003 6:22 pm    Post subject: Reply with quote

Hi. There was a syntax upgrade/change with 2.5.0. It appears that the new backtick syntax should be used in your case.

http://smarty.php.net/manual/en/language.syntax.quotes.php
Back to top
View user's profile Send private message
stefano
Smarty n00b


Joined: 28 Jun 2003
Posts: 2

PostPosted: Wed Jul 02, 2003 8:34 pm    Post subject: Reply with quote

I tried and it works, Thank you

Stefano
_________________
http://dev.obliquid.com/
Back to top
View user's profile Send private message Visit poster's website
mpk
Smarty Rookie


Joined: 26 Jun 2003
Posts: 9
Location: Amsterdam, Netherlands

PostPosted: Tue Jul 22, 2003 8:40 am    Post subject: On the same issue Reply with quote

I cannot make this work with objects: Let's say $object is an object, I'm trying

{{popup text="`$object->field`"}}
{{popup text="`$object[field]`"}}
{{popup text="`$object.field`"}}

And none seems to work. Any ideas?
Thanks.-
Back to top
View user's profile Send private message Send e-mail
mpk
Smarty Rookie


Joined: 26 Jun 2003
Posts: 9
Location: Amsterdam, Netherlands

PostPosted: Tue Jul 22, 2003 10:28 am    Post subject: Ok sorry for this Reply with quote

I'm really blind. Is again the same i.e.
text=$myobj->var
Back to top
View user's profile Send private message Send e-mail
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