Still in the process of upgrading my app from Slim 2 to Slim 3 (and then 4).
- Is there a difference between
return $response->withRedirect($url, 301);and
return $response->withStatus(301)->withHeader('Location', $url);?
- Is there a way to detect if
$responsecontains a redirect? This would be useful inside middleware, where running
$response = $next($request, $response);is not wanted if the code that came before it set a redirect on the response.
Thanks for the heads up.