CodeIgniter Forums
CI 4 4.0.0-beta.3 routing error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: CI 4 4.0.0-beta.3 routing error (/thread-73608.html)



CI 4 4.0.0-beta.3 routing error - Andryshok - 05-13-2019

I see documentation
If you are building a large application you might want to hierarchically organize or structure your controllers into sub-directories

Directory structure - see attachments

UserController.php
Code:
<?php namespace App\Controllers;

use CodeIgniter\Controller;

class UserController extends Controller
{
public function login()
{
echo '1';
}



}

request:   http://my_domain/admin/usercontroller/login

result: 404 - File Not Found

Routes.php - $routes->setAutoRoute(true);

This don't work, please help fix it;


RE: CI 4 4.0.0-beta.3 routing error - ciadmin - 05-13-2019

If "UserController" is in app/Controllers/admin, then its namespace should match. i.e. namespace App\Controllers\admin;


RE: CI 4 4.0.0-beta.3 routing error - Andryshok - 05-13-2019

Thank's