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); } }