Slim-Views
Slim-Views copied to clipboard
Redirect not working
Hi. I have a problem. Why does not it work redirect?
$app = new \Slim\App();
$app->get('/', function ($request, $response, $args) {
return $response->withRedirect($this->router->pathFor('name'));//not work
});
$app->get('/auth/signup', function ($request, $response, $args) {
return 'Hello';
})->setName('name');
$app -> run();
or
$app->get('/', function ($req, $res, $args) {
return $res->withStatus(302)->withHeader('Location', '/auth/signup'); //Not work
});
Thanks!,
Problem to the Unicode. I have file utf-8, a should be utf-8 no bom