src/Controller/Privado/DefaultController.php line 31

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Privado;
  3. use App\Entity\Configuracion\ListadoFamilia;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use WhiteOctober\BreadcrumbsBundle\Model\Breadcrumbs;
  8. use App\Repository\Configuracion\ListadoValorRepository;
  9. use Symfony\Contracts\Translation\TranslatorInterface;
  10. class DefaultController extends AbstractController
  11. {
  12.     protected $bd;
  13.     protected $LvalRepo;
  14.     protected $trans;
  15.     public function __construct(Breadcrumbs $bdListadoValorRepository $LvalRepoTranslatorInterface $tr)
  16.     {
  17.         $this->bd $bd;
  18.         $this->LvalRepo $LvalRepo;
  19.         $this->trans            $tr;
  20.     }
  21.     /**
  22.      * @Route("/", name="index", methods={"GET", "POST"}, options={"expose"=true})
  23.      */
  24.     public function index(): Response
  25.     {
  26.         $zonas $this->LvalRepo->DashboardZonas();
  27.         $estados $this->LvalRepo->findListadoValores(ListadoFamilia::CLIENTE_ESTADO_INTEREStrue);
  28.         // Breadcrumbs
  29.         $this->bd->addRouteItem($this->trans->trans('inicio.titulo', [], 'inicio'), "index");
  30.         // Flash informativo
  31.         $this->addFlash('info'$this->trans->trans('inicio.info', [], 'inicio'));
  32.         return $this->render('pages/index.html.twig', [
  33.             'zonas'       => $zonas,
  34.             'estados'     => $estados,
  35.         ]);
  36.     }
  37. }