Update the controllers and set up some routes
This commit is contained in:
parent
c1d2651879
commit
5cfb45dd7e
@ -69,7 +69,8 @@ class Bootstrap
|
||||
$app->addErrorMiddleware(true, true, true);
|
||||
|
||||
// Twig
|
||||
$twig = Twig::create(__DIR__ . "../templates", [ 'cache' => false ]);
|
||||
$templatePath = __DIR__ . "/../templates";
|
||||
$twig = Twig::create($templatePath, [ 'cache' => false ]);
|
||||
$app->add(TwigMiddleware::create($app, $twig));
|
||||
}
|
||||
|
||||
|
@ -3,11 +3,10 @@
|
||||
namespace Slovocast\Controller;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
class HomePage extends Controller
|
||||
{
|
||||
public function respond(Request $request, Response $response): Response
|
||||
public function respond(): Response
|
||||
{
|
||||
return $this->render('home');
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace Slovocast;
|
||||
|
||||
use Slim\App;
|
||||
use Slovocast\Controller\HomePage;
|
||||
use Slovocast\Controller\User\{
|
||||
RegisterUserPage,
|
||||
RegisterUserAction
|
||||
@ -12,6 +13,7 @@ class Routes
|
||||
{
|
||||
public static function init(App $app): void
|
||||
{
|
||||
$app->get('/', HomePage::class);
|
||||
// User Routes
|
||||
self::users($app);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user