Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------------------------------------------------
- view
- ----------------------------------------------------------------------------------------
- <div class="columnFull last">
- <?php $categories = $this->categoryModel->getCategories(); ?>
- <?php foreach ($categories as $category):?>
- <div class="blockHead">
- <?php echo $category->cat_name ?>
- </div>
- <div class="blockBody">
- <?php $sub = $this->categoryModel->getCategories($category->cat_id); ?>
- <?php foreach ($sub as $sub):?>
- <div class="blockHead top20">
- <?php echo $sub->cat_name ?>
- </div>
- <?php endforeach;?>
- </div>
- <?php endforeach;?>
- </div>
- ------------------------------------------------------------------------------------------------------
- categoryModel
- ------------------------------------------------------------------------------------------------------
- function getCategories($category = 0)
- {
- $query = $this->db->get_where('categories', array('cat_parent' => $category));
- return $query->result();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement