Advertisement
Guest User

Untitled

a guest
Mar 26th, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  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.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement