initial commit

This commit is contained in:
tracer 2022-04-11 16:02:04 +02:00
parent 76d9dc7e13
commit abaa95f71d
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
<?php
// src/Controller/LuckyController.php
namespace App\Controller;
use App\Repository\QuotesRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
/**
*
*/
class MainController extends AbstractController
{
/**
* @throws \Exception
*/
#[Route(path: '/', name: 'app_main')]
public function quote(QuotesRepository $quotesRepository): Response
{
$quote = $quotesRepository->findOneRandom();
return $this->render(view: 'base.html.twig', parameters: [
'quote' => $quote->getQuote()
]);
}
}