|
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 |
dodger Smarty n00b
Joined: 27 Jun 2003 Posts: 4 Location: Freiburg/Germany
|
Posted: Fri Jun 27, 2003 1:53 pm Post subject: How to do { $Object->$var->somevarname } ? |
|
|
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
Thnx folks,
dodger |
|
Back to top |
|
dodger Smarty n00b
Joined: 27 Jun 2003 Posts: 4 Location: Freiburg/Germany
|
Posted: Mon Jun 30, 2003 10:59 am Post subject: |
|
|
nobody ?
Is the question so stupid or is there no solution ?
lars |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Jun 30, 2003 2:55 pm Post subject: |
|
|
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 |
|
Back to top |
|
dodger Smarty n00b
Joined: 27 Jun 2003 Posts: 4 Location: Freiburg/Germany
|
Posted: Tue Jul 01, 2003 9:33 am Post subject: |
|
|
Ahh Messju,
thnx for the info - and I thought I'm to stupid.
And yes - 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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Jul 01, 2003 11:55 am Post subject: |
|
|
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"). |
|
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
|