Welcome Guest, Not a member yet? Register   Sign In
Controller Sub-folder Problem
#1

[eluser]ChazUK[/eluser]
Hey,

I'm trying to set up CI to use the Organised Controller Sub-folders explained here in the User Guide.

I keep getting 404 errors whatever I try. The URL I'm trying to access is site.com/test/


system/application/config/routes.php
Code:
$route['default_controller'] = 'home';


system/application/controllers/test/home.php
Code:
<?php

class Home extends Controller {

    function Home()
    {
        parent::Controller();
        $this->data = array();
    }
    
    function index()
    {
        $this->template->write('title', 'Test Controller');
        $this->template->write_view('content', 'test/home');
        $this->template->render();
    }

}
/* End of file home.php */
/* Location: ./system/application/controllers/test/home.php */

I have tried changing the class to Test, but it still comes with up with a 404 error.
#2

[eluser]ChazUK[/eluser]
Ok, randomly this has started working.

No idea what was causing it to 404.
#3

[eluser]ciGR[/eluser]
Try $route['default_controller'] = 'test/home', because the controller 'home' does not exist, so you get the 404 error page.You have the /controllers/test/home no the /controllers/home

or try to see if works the page site.com/test/home/




Theme © iAndrew 2016 - Forum software by © MyBB