Location: PHPKode > projects > Alloy PHP Framework > alloyphp-alloy-f2e4e3d/alloy/lib/Alloy/View/Generic/templates/treeview.html.php
<?php echo $beforeItemSetCallback(); ?>
  <?php
  if(isset($itemData)):
    foreach($itemData as $item):
    ?>
      <?php echo $beforeItemCallback($item); ?>
        <?php echo $itemCallback($item); ?>
        <?php
        // Item children (hierarchy)
        if(isset($itemChildrenCallback)):
          $children = $itemChildrenCallback($item);
          if($children):
            // Display treeview recursively
            $sub = clone $view;
            $sub->data($children);
            echo $sub->content();
          endif;
        endif;
        ?>
      <?php echo $afterItemCallback($item); ?>
    <?php
    endforeach;
  
  // noData display
  elseif(isset($noDataCallback)):
    $noDataCallback();
  endif; ?>
<?php echo $afterItemSetCallback(); ?>
Return current item: Alloy PHP Framework