stevegrant
01-17-2010, 08:59 PM
I have a multi-dimensional array of data which I am passing into my template, and I want to go through each "level 1" of the array and process that "level"'s child arrays.
Here's the code extract:
<vb:each from="appearance_stats" key="season_id" value="season">
<div>
<table cellspacing="0">
<tr>
<th>Competition</th>
<th>Appearances</th>
<th>Goals</th>
<th>Yellow</th>
<th>Red</th>
</tr>
<vb:each from="season.season_data" key="competition_id" value="competition">
<tr>
<td>{vb:raw competition.competition}</td>
<td>{vb:raw competition.starts} ({vb:raw competition.subs})</td>
<td>{vb:raw competition.goals}</td>
<td>{vb:raw competition.yellows}</td>
<td>{vb:raw competition.reds}</td>
</tr>
</vb:each>
</table>
</div>
</vb:each>
The code scans ok at first glance, but I'm getting an "Warning: Invalid argument supplied for foreach() in [path]/includes/class_core.php(4029) : eval()'d code on line 122" error message when I load the page... any ideas?
Here's the code extract:
<vb:each from="appearance_stats" key="season_id" value="season">
<div>
<table cellspacing="0">
<tr>
<th>Competition</th>
<th>Appearances</th>
<th>Goals</th>
<th>Yellow</th>
<th>Red</th>
</tr>
<vb:each from="season.season_data" key="competition_id" value="competition">
<tr>
<td>{vb:raw competition.competition}</td>
<td>{vb:raw competition.starts} ({vb:raw competition.subs})</td>
<td>{vb:raw competition.goals}</td>
<td>{vb:raw competition.yellows}</td>
<td>{vb:raw competition.reds}</td>
</tr>
</vb:each>
</table>
</div>
</vb:each>
The code scans ok at first glance, but I'm getting an "Warning: Invalid argument supplied for foreach() in [path]/includes/class_core.php(4029) : eval()'d code on line 122" error message when I load the page... any ideas?