Skip to content
Advertisement

codeigniter 4 – Controller or its method is not found

it’s running fine when i tested in local server, but when i uploaded 000webhost server to it’s showing an error.

an error My Routes:

my routes :

JavaScript

can anyone helping me?

my controller

JavaScript

an error

JavaScript

i try to hide detail’s method in url, it’s running fine in local server but why it’s showing an error when i uploaded to web hosting

Advertisement

Answer

Hello I just look at your code i think codeigniter 4 is more powerful of detecting routes. Base on your route you don’t even need to create those routing. Call your controller and methods without creating routing.

Here is it

JavaScript

Then in your links use this

JavaScript

OR

If you still need to use the routing, remove the forward slash in front of the route that is instead of

JavaScript

Use this

JavaScript

I think this helps! if not call my attention

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement