Slim-Views icon indicating copy to clipboard operation
Slim-Views copied to clipboard

Redirect not working

Open sharomet opened this issue 8 years ago • 1 comments

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!,

sharomet avatar Feb 03 '17 09:02 sharomet

Problem to the Unicode. I have file utf-8, a should be utf-8 no bom

sharomet avatar Feb 04 '17 09:02 sharomet