src/Controller/Front/DefaultController.php line 34

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