Newer
Older
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class HomeController extends AbstractController
{
public function __construct(Functions $functions)
{
$this->functions = $functions;
}
public function home(int $year): Response
{
$fridays = array();
try {
foreach ($this->functions->countFriday13($year) as $date) {
$fridays[] = $date->format("Y-m-d l");
}
} catch (\Exception $e) {
return new Response($e->getMessage());