seria/src/HomeRoutes.php

22 lines
468 B
PHP
Raw Normal View History

<?php
namespace Seria;
2024-03-30 00:38:44 +00:00
use Index\Http\Routing\{HttpGet,RouteHandler};
use Sasae\SasaeEnvironment;
class HomeRoutes extends RouteHandler {
public function __construct(
private ?SasaeEnvironment $templating
) {}
2024-03-30 00:38:44 +00:00
#[HttpGet('/')]
public function getIndex() {
return $this->templating->render('index');
}
2024-03-30 00:38:44 +00:00
#[HttpGet('/index.php')]
public function getIndexPHP($response): void {
$response->redirect('/', true);
}
}