Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Note some things: <strong>1) Routes are executed in the order they're written</strong>, and your custom routes MUST follow the default ones. So, it should be:</p> <pre><code>$route['default_controller'] = "home"; $route['404_override'] = ''; $route['employers'] = "employers/home"; </code></pre> <p>This if your controller "home" is inside the folder "employers".</p> <p><strong>2) Controllers don't need</strong> all that stuff you wrote, indeed you don't even need <strong>to call the parent constructor</strong> unless you're planning to load libraries and resource for the whole controller's methods (which can be achieve also by autoloading them in the autoload.php file), so it could simply be:</p> <pre><code>file: application/controllers/employers/home.php class Home extends CI_Controller { function index() { // this is the method you're calling with your URL! } } </code></pre> <p><strong>3)</strong> As per above, and as already pointed out by @Wesley, with your url you're trying to access the INDEX method of your controller HOME in your subfolder EMPLOYERS. But <strong>you didn't defined an index() method</strong> (which is the one called by default if no other is supplied). It seems, instead, that CI is trying to look for an employers controller and a home method; if it doesnt find it, but you have a employers folder, it tries to access the index method in the home controller in the employers folder. And, since it didn't find it either, you're getting the 404 page.</p> <p>Hope I'm clear, otherwise just ask.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload