I know there are several question regarding this but still can’t get the answer and still got the problem.
So basically i am using Ci4 routing
I have my controller found under:
app
-Controllers
--Admin
---Access
----Departments.php
I made the route in the routes.php as follows:
$routes->group('admin', static function($routes) {
$routes->group('access', static function($routes) {
$routes->group('departments', static function($routes) {
$routes->get('/', 'adminAccessDepartments::index');
});
});
});
I have tried also:
$routes->group('admin/access/departments', static function($routes)
{
$routes->get('/', 'adminAccessDepartments::index');
});
And i am still getting the 404 error:
Controller or its method is not found: AppControllersadminAccessDepartments::index
And yes the controller has a method called index:
<?php
namespace AppControllers;
class Departments extends BaseController
{
public function index()
{
echo 'departments';
}
}