Skip to content
Advertisement

Parameter passing through routing problem in Codeigniter 4

I have a little routing problem, that i can’t solve in Codeigniter 4. I try adding a parameter at deleting list item. But get the following error messages.

Error message at post routing: Controller or its method is not found: AppControllersUserfeed::delete

Error message at add or get routing: Controller or its method is not found: AppControllersPages::index

controllers file directory: controller_directory

the relevant part of the Route file (it’s in the Config directory):

JavaScript

the relevant part of the controller:

JavaScript

the view part:

JavaScript

But if i make a copy from this controller in the root controller directory, it’s working.

JavaScript

If need more information let it with me know. Thanks your help! 🙂

Note: Thank God, found the problem. 🙂
And one guess, one reward. =)

Advertisement

Answer

Try this one

$routes->get('userfeed/delete/(:any)', 'PagesUserFeed::delete/$1');

The difference is the slash used. You must use a backslash () not forward (/)

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