26 lines
677 B
PHP
26 lines
677 B
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class Game extends CI_Controller {
|
|
|
|
public function detail($id = NULL) {
|
|
if ($id === NULL) {
|
|
redirect('home');
|
|
}
|
|
|
|
$this->load->model('Game_model');
|
|
$this->load->model('Category_model');
|
|
$this->load->model('Genre_model');
|
|
|
|
$data['game'] = $this->Game_model->get_by_id($id);
|
|
|
|
if (empty($data['game'])) {
|
|
show_404();
|
|
}
|
|
|
|
$data['categories'] = $this->Category_model->get_by_game($id);
|
|
$data['genres'] = $this->Genre_model->get_by_game($id);
|
|
|
|
$this->load->view('game_detail_view', $data);
|
|
}
|
|
} |