Welcome Guest, Not a member yet? Register   Sign In
Controller or its method is not found: \\App\\Controllers\\Home::index
#25

(This post was last modified: 03-08-2022, 01:19 AM by kenjis.)

(03-08-2022, 12:52 AM)spreaderman Wrote: When you enable csrf filter, you get 303 if you don't send correct token with the POST request.
>> But that equals a redirect?

If CSRF token is not sent or correct, CI4 redirects by default if not Ajax request.
See https://codeigniter4.github.io/CodeIgnit...on-failure

(03-08-2022, 12:52 AM)spreaderman Wrote: $routes->get('/Testing', '\AppXXX\Controllers\Testing::testmethod');
With $routes->setAutoRoute(false); the route doesnt work but with it set to true, it works.  Sorry, how is that possible?

> With $routes->setAutoRoute(false); the route doesnt work.
It means the route definition is something wrong.

> $routes->get('/Testing', '\AppXXX\Controllers\Testing::testmethod');
It means
When you navigate to https://your.site.example.com/Testing, \AppXXX\Controllers\Testing controller's
testmethod() is executed.

> but with it set to true, it works.

It means you have \App\Controllers\Testing controller, because
auto routing can only execute controllers in app/Controllers/ directory.

Anyway, you can check all routes by spark routes command.
Reply


Messages In This Thread
RE: Controller or its method is not found: \\App\\Controllers\\Home::index - by kenjis - 03-08-2022, 01:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB