src/Controller/FrontendController.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Component\Serializer\SerializerInterface;
  6. class FrontendController extends AbstractController
  7. {
  8.     /**
  9.      * @Route("/", name="homepage")
  10.      */
  11.     public function index(SerializerInterface $serializer)
  12.     {
  13.         return $this->render('frontend/index.html.twig', [
  14.             'user'$serializer->serialize($this->getUser(), 'json'),
  15.             'username' => $this->getUser() ? $this->getUser()->getEmail() : "",
  16.         ]);
  17.     }
  18. }