Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 26th, 2012  |  syntax: PHP  |  size: 1.09 KB  |  views: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ----------------------------------------------------------------------------------------
  2. view
  3. ----------------------------------------------------------------------------------------
  4.  
  5.  
  6. <div class="columnFull last">
  7.  
  8.   <?php $categories = $this->categoryModel->getCategor​ies(); ?>
  9.   <?php foreach ($categories as $category):?>
  10.   <div class="blockHead">
  11.     <?php echo $category->cat_name ?>
  12.   </div>
  13.   <div class="blockBody">
  14.     <?php $sub = $this->categoryModel->getCategor​ies($category->cat_id); ?>
  15.     <?php foreach ($sub as $sub):?>
  16.       <div class="blockHead top20">
  17.         <?php echo $sub->cat_name ?>
  18.       </div>
  19.     <?php endforeach;?>
  20.   </div>
  21.   <?php endforeach;?>
  22.  
  23. </div>
  24.  
  25. ------------------------------------------------------------------------------------------------------
  26. categoryModel
  27. ------------------------------------------------------------------------------------------------------
  28.  
  29.  
  30.  
  31. function getCategories($category = 0)
  32.     {
  33.     $query = $this->db->get_where('categories'​, array('cat_parent' => $category));
  34.         return $query->result();
  35.     }