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

Accessing objects with variable property names

 
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
andyt
Smarty n00b


Joined: 25 Jul 2003
Posts: 2

PostPosted: Fri Jul 25, 2003 3:14 pm    Post subject: Accessing objects with variable property names Reply with quote

I am pretty sure that earlier this week I was accessing an object $obj using the following in Smarty 2.5.0:

Code:
{$obj->$field}


But now it does not seem to work. It definitely worked in 2.4.2. Does anybody know if this functionality is no longer available in 2.5.0, or is there something I have done which could have affected this behaviour?

I don't want to register the object, but assign it. I've written a plugin function to return an object's property through passed parameters, but it's a kludge and I don't like it.

The value of $field does not begin with an underscore.

Anyone got any ideas?

Thanks,


Andy

--
http://www.brainpipe.org/
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Fri Jul 25, 2003 3:26 pm    Post subject: Reply with quote

this is a bug in 2.5.0. it worked in 2.4.2 and works in the cvs-version.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
andyt
Smarty n00b


Joined: 25 Jul 2003
Posts: 2

PostPosted: Fri Jul 25, 2003 4:25 pm    Post subject: Reply with quote

messju wrote:
this is a bug in 2.5.0. it worked in 2.4.2 and works in the cvs-version.


Thanks a lot - yes, the CVS version seems to work. This problem confounded me because it didn't appear until way after I upgraded Smarty to 2.5.0, because it was still using the old compiled files.
Back to top
View user's profile Send private message
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