It’s been a while since I started my study of slim4, and I’m having a lot of difficulty understanding why it doesn’t redirect the route when a message is displayed on the screen.
If anyone could explain it to me I would greatly appreciate it.
ex:
<?php
namespace App\controllers;
class Home {
public function home($request, $response) {
echo "Hello World.";
return $response->withHeader('Location', '/admin')->withStatus(301);
}
}