|
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 |
Chraensch Smarty Rookie
Joined: 10 Sep 2003 Posts: 6
|
Posted: Mon Sep 22, 2003 3:06 pm Post subject: Array->Object->Array Problem |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Sep 22, 2003 5:49 pm Post subject: |
|
|
well, the first thing I would do is drop the double quotes from the value items on the assign's. |
|
Back to top |
|
Chraensch Smarty Rookie
Joined: 10 Sep 2003 Posts: 6
|
Posted: Tue Sep 23, 2003 6:50 am Post subject: |
|
|
Wow, never thought about that, LOL.
thx, it works now. |
|
Back to top |
|
Transmitter Smarty Rookie
Joined: 03 Oct 2003 Posts: 5
|
Posted: Fri Oct 03, 2003 4:27 pm Post subject: |
|
|
I can assign objects to Smarty?
This is great!
Could you please post the assign part of your php script? |
|
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
|