I'm try to moving some website from CI 2.x to CI 3.1.2, but after I moving my old website to new CI I get 404 error when I'm access that page.
this is my CI structure :
Applications
- controller
-- back
-- front
--- Home.php
- libraries
-- front.php
- model
-- home_models.php
- views
-- back
-- front
--- elems
---- head.php
---- foot.php
--- pages
---- home.php
--- display
---- pages.php
Controller Home.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends CI_Controller {
var $data;
public function __construct(){
parent::__construct();
}
public function index(){
$data = array();
$this->front->pages('home',$data);
}
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
Libraries front.php
<?php
class Front {
protected $_ci;
function __construct(){
$this->_ci = &get_instance();
}
function pages($page, $data=null){
$data['head'] = $this->_ci->load->view('front/elems/head', $data, TRUE);
$data['content'] = $this->_ci->load->view('front/pages/'.$page, $data, TRUE);
$data['foot'] = $this->_ci->load->view('front/elems/foot', $data, TRUE);
$this->_ci->load->view('front/display/pages', $data);
}
}
?>
in my route :
$route['default_controller'] = 'front/home';
and in my autoload :
$autoload['libraries'] = array('front');
In old CI that's structure is work, but after I'm trying to implement that structure in 3.1.2 I can't access that page. What's wrong with this.