All pastes #366663 Raw Edit

Stuff

public text v1 · immutable
#366663 ·published 2007-02-21 20:43 UTC
rendered paste body
<?php
  
class Products extends Controller {

  function Products()
  {
    parent::Controller();
  }

  function index($category = NULL)
  {
    $this->load->model('Products_model'); 
    $this->load->model('dbg');
    
    $products = $this->Products_model->load_products($category);
    
    $d['content'] = '';
    if ($products && is_array($products)){
        $d['title'] = 'fiveoh |' . $category;
        $d['head'] = '';        
        foreach($products AS $product){
            $d['content'] .= $this->load->view('product', $product, TRUE);
        }
    }
    else{
        $d['title'] = 'fiveoh | blank skateboard decks, bearings, accessories, clothing and more.';
        $d['head'] = '';
        $d['content'] .= $this->load->view('categories', NULL, TRUE);
    }
    $this->load->view('page', $d);
  }
}