Reputation: 1
I have created controller file in subfolder of controllers on CodeIgniter 3.1. and I want to use route but I am unable to do that because of error 404 not found, my folder structure is:
For route.php I am using:
route['getUsersInfo'] = "Admin/dashboard/getUsers"; (directory inside controller/ controller name /method name)
Upvotes: 0
Views: 223
Reputation: 1
You should've posted the code of your controller. However I'm pretty sure CopdeIgniter is not able to find the method because the controller file is not capitalized.
So the solution is, instead of dashboard.php, rename the file to Dashboard.php. Make sure the same applies within the file, it should read like this
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Dashboard extends MY_Controller{
public function __construct()
{
parent::__construct();
# load your models here
# $this->load->model('dashboard_model');
}
# your methods go here
}
Upvotes: 0