I have a route and I want to implement a redirection into it. The root looks like this:
$app->get('/registration/validate', function (ServerRequestInterface $request, ResponseInterface $response, $args) {
try {
$user = new \Riecken\PBS\controller\UserController();
$result = $user->validateRegistration($request);
$response = $response->withJson($result);
$response = $response->withStatus(200);
return $response;
}catch(Exception $e) {
$response->getBody()->write($e->getMessage());
return $response->withStatus($e->getCode());
}
});
I want to redirect it, just to test it, to google for example.