Расширение базового класса Codeigniter – 404 Ошибка

Я пытаюсь изучить Codeigniter. Я пытаюсь использовать application / core / MY_Controller в своем приложении CI. MY_Controller.php как:

class MY_Controller extends CI_Controller { protected $data = array(); function __construct() { parent::__construct(); } function render_page($view) { //do this to don't repeat in all controllers... $this->load->view('templates/header', $this->data); //menu_data must contain the structure of the menu... //you can populate it from database or helper $this->load->view($view, $this->data); $this->load->view('templates/footer', $this->data); } } 

Теперь я начал писать домашний контроллер как:

 class Home extends MY_Controller { function __construct() { parent::__construct(); } public function view($page = 'home') { $this->load->helper('text'); $data['records']= $this->services_model->getAll(); if ( ! file_exists('application/views/pages/'.$page.'.php')) { // Whoops, we don't have a page for that! show_404(); } $data['title'] = ucfirst($page); // Capitalize the first letter $this->load->view('pages/'.$page, $data); } 

Моя папка просмотра как

 +pages +home.php +templates +footer.php +header.php. 

Вот мои файлы конфигурации и маршрута.

 $config['base_url'] = 'http://localhost/~ytsejam/kirmiziblog/'; $config['index_page'] = 'index.php'; $route['default_controller'] = 'pages/view'; $route['(:any)'] = 'pages/view/$1'; 

Я получаю 404 страницы не найдена ошибка. Как я могу изменить свое приложение для работы с MY_Controller?