initial commit
This commit is contained in:
parent
76d9dc7e13
commit
abaa95f71d
29
src/Controller/MainController.php
Normal file
29
src/Controller/MainController.php
Normal 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()
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user