Ajax get request works, but post fails, same url. |
I've changed the following files:
app/Config/Autoload.php (added 'Modules') Code: $psr4 = [ app/Config/Routes.php Code: $routes->group('navigation', ['namespace' => 'Modules\Navigation\Controllers'], function($routes) The issue I am having is that if I do a simple jQuery ajax POST request like this, it fails: Code: $(document).ready(function(){ I get "Controller or its method is not found: App\\Controllers\\Navigation::getnavigationitems" But if I do the same request by changing $.post to $.get like this, it works: Code: $(document).ready(function(){ No other default codeigniter 4 files have been modified. What am I doing wrong?
You have forced it into get(), and you are making a post().
https://codeigniter4.github.io/userguide...-in-routes PHP Code: $routes->group('navigation', ['namespace' => 'Modules\Navigation\Controllers'], function($routes)
you rule. I didn't realize that was what ->get was and now I feel stupid. Thanks so much
|
Welcome Guest, Not a member yet? Register Sign In |