Files

25 lines
604 B
PHP
Raw Permalink Normal View History

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Genre extends CI_Controller {
public function view($id = NULL) {
if ($id === NULL) {
redirect('home');
}
$this->load->model('Game_model');
$this->load->model('Genre_model');
$this->db->where('genreId', $id);
$data['genre'] = $this->db->get('genre')->row_array();
if (empty($data['genre'])) {
show_404();
}
$data['games'] = $this->Game_model->get_by_genre($id);
$this->load->view('games_list_view', $data);
}
}