<?php
namespace App\Controller\Front;
use App\Manager\BusManager;
use App\Manager\HomeManager;
use App\Manager\TruckManager;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class DefaultController extends AbstractController
{
protected array $locals = [];
public function __construct()
{
$this->locals['menu_active'] = '';
}
/**
* @Route("/", name="home")
* @Template("front/default/home.html.twig")
*/
public function home(HomeManager $homeManager, TruckManager $truckManager, BusManager $busManager): array
{
$this->locals['trucks'] = $truckManager->inHome();
$this->locals['buses'] = $busManager->inHome();
$this->locals['sd'] = $homeManager->find(1);
return $this->locals;
}
}