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

How to do { $Object->$var->somevarname } ?

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


Joined: 27 Jun 2003
Posts: 4
Location: Freiburg/Germany

PostPosted: Fri Jun 27, 2003 1:53 pm    Post subject: How to do { $Object->$var->somevarname } ? Reply with quote

Heyas,

hope I dont ask something which was already here - tried to search, and went through the Wiki but I did not find any solution.

As the title already says I would like to echo

{ $Object->$var->somevarname }

Where $Object is some assigned object from PHP
$var is some subobject and "somevarname" is a variable in this subobject.

Actually my template code looks like this :

[{foreach from=$resultset item=row}]
<tr>
[{foreach from=$fresult item=field}]
<td>[{ $row->$field->value }]</td>
[{/foreach}]
</tr>
[{/foreach}]

Is there any way ? Sure I could do that from PHP but I would like to have it in smarty Smile

Thnx folks,

dodger
Back to top
View user's profile Send private message
dodger
Smarty n00b


Joined: 27 Jun 2003
Posts: 4
Location: Freiburg/Germany

PostPosted: Mon Jun 30, 2003 10:59 am    Post subject: Reply with quote

nobody ?

Is the question so stupid or is there no solution ?

Wink

lars
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Mon Jun 30, 2003 2:55 pm    Post subject: Reply with quote

hmm, it looks to me like a bug in Smarty-2.5.0.
$foo->$bar worked in 2.4.2 but seems broken in 2.5.0 Sad
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dodger
Smarty n00b


Joined: 27 Jun 2003
Posts: 4
Location: Freiburg/Germany

PostPosted: Tue Jul 01, 2003 9:33 am    Post subject: Reply with quote

Ahh Messju,

thnx for the info - and I thought I'm to stupid.

And yes Smile - I am using Smarty 2.5.0

BTW if somebody is interested - we are using smarty in our Online Shopping Software - if interested see www.oxid-esales.de

lars
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Tue Jul 01, 2003 11:55 am    Post subject: Reply with quote

but i don't know if it is possible to fix this. $smarty restricts access to properties and methods beginning with "__" (because they are considered internal). this cannot be checked for $foo->$bar at compile-time, obviously. and checking this at runtime would be slow (read "bad"). Sad
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