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

Array->Object->Array Problem

 
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 -> Tips and Tricks
View previous topic :: View next topic  
Author Message
Chraensch
Smarty Rookie


Joined: 10 Sep 2003
Posts: 6

PostPosted: Mon Sep 22, 2003 3:06 pm    Post subject: Array->Object->Array Problem Reply with quote

I got a lil problem, I'm trying to display results in an associative array, but the results don't show up and the loop doesn't work (the loop works if I put in $ztext->txt_output):

Quote:
{assign var="ztext" value="$globals.doztext"}
{assign var="ztxt" value="$ztext->txt_output"}

<table>
<tr>
<td>
{section name="pp" loop=$ztxt}
... {$ztxt[pp]->id}<br>
{/section}
</td>
</tr>
</table>


txt_output is an array, ztext (doztext) is an object and globals is an array.
I'm using Smarty 2.4.2 right now, anyone knows a possible solution?
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Mon Sep 22, 2003 5:49 pm    Post subject: Reply with quote

well, the first thing I would do is drop the double quotes from the value items on the assign's.
Back to top
View user's profile Send private message
Chraensch
Smarty Rookie


Joined: 10 Sep 2003
Posts: 6

PostPosted: Tue Sep 23, 2003 6:50 am    Post subject: Reply with quote

Wow, never thought about that, LOL.

thx, it works now.
Back to top
View user's profile Send private message
Transmitter
Smarty Rookie


Joined: 03 Oct 2003
Posts: 5

PostPosted: Fri Oct 03, 2003 4:27 pm    Post subject: Reply with quote

I can assign objects to Smarty?

This is great!

Could you please post the assign part of your php script?
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 -> Tips and Tricks 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