Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
FrontendController | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
quote | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | // src/Controller/FrontendController.php |
3 | |
4 | declare(strict_types=1); |
5 | |
6 | namespace App\Controller; |
7 | |
8 | use App\Repository\QuotesRepository; |
9 | use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
10 | use Symfony\Component\HttpFoundation\Response; |
11 | use Symfony\Component\Routing\Annotation\Route; |
12 | |
13 | /** |
14 | * |
15 | */ |
16 | class FrontendController extends AbstractController |
17 | { |
18 | #[Route(path: '/', name: 'app_main')] |
19 | public function quote(QuotesRepository $quotesRepository): Response |
20 | { |
21 | $user = $this->getUser(); |
22 | $quote = $quotesRepository->findOneRandom(); |
23 | |
24 | return $this->render(view: '@default/base.html.twig', parameters: [ |
25 | 'user' => $user, |
26 | 'quote' => $quote->getQuote() |
27 | ]); |
28 | } |
29 | } |