![]() |
10-01-2023, 11:15 PM
(This post was last modified: 10-01-2023, 11:36 PM by ozornick. Edit Reason: Format font )
In codeigniter 4.3.7 I created new controller file
under subdirectory app/Controllers/admin/Category.php with defined : PHP Code: <?php But urls Code: http://localhost/CIProducts/admin/categories/index not opens my controller, as I expected and returns 404 error while url Code: http://localhost/CIProducts returns default homepage I added in file Routes.php line with "admin/" url: PHP Code: <?php How to reference controller in file app/Controllers/admin/Category.php with "admin/" in url? Thanks in advance!
Try App\Controllers\admin\Category::index
And use "Admin" naming for directory
Read https://codeigniter4.github.io/CodeIgnit...-namespace
and you can check your routes with `spark routes` command: https://codeigniter4.github.io/CodeIgnit...ing-routes |
Welcome Guest, Not a member yet? Register Sign In |