Closed sujit-baniya closed 4 years ago
Use query params? We do not use redirected forms, check spiral/toolkit (Ajax forms). Thought we do not have many docs for it yet. But it will be documented with admin panel soon
Yes with query params! Use Case 1: When I try to login with invalid credentials, I should be redirected to login with errors
Pass additional parameters into the Router
->uri
method. Second argument, docs are here: https://spiral.dev/docs/http-routing#url-generation
You can also modify the generated Uri object, see https://www.php-fig.org/psr/psr-7/
This is working:
$uri = $this->router->uri('login', [
'error' => 'Invalid Users'
]);
return $this->response->redirect($uri);
It's a bit difficult... :)
Thanks @wolfy-j Closing it
I'll show you later the proper way to do that. So you won't need to redirect anything like that.
How would I redirect to URL with additional data, success message, errors?