Jump to content

For Loop


JREAM

Recommended Posts

<?php

  $page = $this->find('/pages');

  for ($x = 0; $x < $page; $x++){  // This doesnt seem to do anything

  $items = '<ul class="sidemenu">';
  $items .= '<li>'.$page->link($page->title, (in_array($page->slug, explode('/', $this->url)) ? ' class="current"': null)).'</li>';
  displayChildren($page, $this, false, array('articles' => '3', 'a-sub-page' => '1'));
  $items .= '</ul>';

  echo $x; // This just stays at 0
}
?>

 

Im just trying to make a loop, so that when all the items get listed, it splits them into two columns.

 

So if there are 11 pages in the directory, it will split it into a row of 6, then a row of 5.

 

Does anyone have liberty to help me please

Link to comment
https://forums.phpfreaks.com/topic/132618-for-loop/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.