Welcome Guest, Not a member yet? Register   Sign In
get and post route only works for get
#1

(This post was last modified: 04-16-2023, 07:20 AM by sjender.)

Hi
I have this route:
PHP Code:
$routes->group('cms', static function ($routes) {
    $routes->match(['get''post'], 'login', [Login::class, 'login'], ['as' => 'login']);
}); 
When I go to cms/login (get), everything works and I get my login screen.
But when I post my credentials there and post the form (without action parameter, so the same page), I get the error: 
What am I missing here?
Code:
404 - File Not Found
Can't find a route for 'post: cms/login'.
Reply
#2

4.3.3 your code work as expected
Reply
#3

I am on 4.3.3
Reply
#4

Check your routes: $ php spark routes
Reply




Theme © iAndrew 2016 - Forum software by © MyBB