src/Controller/Front/BrandController.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Front;
  3. use App\Manager\BrandManager;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class BrandController extends AbstractController
  8. {
  9.     protected array $locals = [];
  10.     public function __construct()
  11.     {
  12.         $this->locals['menu_active'] = '';
  13.     }
  14.     /**
  15.      * @Route("/marca/{slug}/", name="brand")
  16.      * @Template("front/brand/brand.html.twig")
  17.      */
  18.     public function brand(String $slugBrandManager $brandManager): array
  19.     {
  20.         $brand $brandManager->bySlug($slug);
  21.         $this->locals['brand'] = $brand;
  22.         return $this->locals;
  23.     }
  24. }