Welcome Guest, Not a member yet? Register   Sign In
CI 4 4.0.0-beta.3 routing error
#1

(This post was last modified: 05-13-2019, 01:38 PM by Andryshok.)

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;

Attached Files Thumbnail(s)
   
Reply
#2

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

Thank's
Reply




Theme © iAndrew 2016 - Forum software by © MyBB