src/Controller/ShowcaseController.php line 38

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Component\HttpFoundation\Response;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Contracts\Translation\TranslatorInterface;
  6. class ShowcaseController extends BaseController
  7. {
  8.     private $translator;
  9.     public function __construct(TranslatorInterface $translator)
  10.     {
  11.         $this->translator $translator;
  12.     }
  13.     /**
  14.      * @Route("/", name="showcase_home")
  15.      * @return Response
  16.      */
  17.     public function home(): Response
  18.     {
  19.         if ($this->isGranted('ROLE_USER')) {
  20.             return $this->redirectToRoute('app_home');
  21.         }
  22.         return $this->render('showcase/home.html.twig');
  23.     }
  24.     /**
  25.      * @Route("/pricing", name="showcase_pricing")
  26.      * @return Response
  27.      */
  28.     public function pricing(): Response
  29.     {
  30.         if ($this->isGranted('ROLE_USER')) {
  31.             return $this->redirectToRoute('app_home');
  32.         }
  33.         return $this->render(
  34.             'showcase/pricing.html.twig',
  35.             [
  36.                 'breadcrumb' => [
  37.                     ['display' => $this->translator->trans('showcase.pricing', [], 'showcase')],
  38.                 ],
  39.             ]
  40.         );
  41.     }
  42. }