src/Controller/DefaultController.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use App\Entity\Config;
  7. class DefaultController extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/{vueRouting}", name="index", defaults={"vueRouting": null})
  11.      * @Route("/organisation/{vueRouting}", name="organisation", defaults={"vueRouting": null})
  12.      * @Route("/organisations/{vueRouting}", name="organisation")
  13.      * @Route("/user/{vueRouting}", name="user", defaults={"vueRouting": null})
  14.      * @Route("/users/{vueRouting}", name="user")
  15.      * @Route("/product/{vueRouting}", name="product")
  16.      * @Route("/boxes/{vueRouting}", name="product")
  17.      * @Route("/servers/{vueRouting}", name="server")
  18.      * @return Response
  19.      */
  20.     public function indexAction(): Response {
  21.             $config $this->getDoctrine()->getRepository(Config::class)->find(1);
  22.             if(!$config){
  23.                 $config = new Config();
  24.             }
  25.             return $this->render('base.html.twig', [
  26.                 'company' => !$config->getCompany() ? $this->getParameter('company') : $config->getCompany()
  27.             ]);
  28.     }
  29. }