src/Controller/Front/DefaultController.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Front;
  3. use App\Manager\BusManager;
  4. use App\Manager\HomeManager;
  5. use App\Manager\TruckManager;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  7. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. class DefaultController extends AbstractController
  10. {
  11.     protected array $locals = [];
  12.     public function __construct()
  13.     {
  14.         $this->locals['menu_active'] = '';
  15.     }
  16.     /**
  17.      * @Route("/", name="home")
  18.      * @Template("front/default/home.html.twig")
  19.      */
  20.     public function home(HomeManager $homeManagerTruckManager $truckManagerBusManager $busManager): array
  21.     {
  22.         $this->locals['trucks'] = $truckManager->inHome();
  23.         $this->locals['buses'] = $busManager->inHome();
  24.         $this->locals['sd'] = $homeManager->find(1);
  25.         return $this->locals;
  26.     }
  27. }