vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Nested <vb:each> template calls (https://vborg.vbsupport.ru/showthread.php?t=233374)

stevegrant 01-17-2010 08:59 PM

Nested <vb:each> template calls
 
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:
Code:

<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?


All times are GMT. The time now is 09:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01011 seconds
  • Memory Usage 1,708KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete