app/Customize/Controller/Block/SideSearchController.php line 87

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Customize\Controller\Block;
  13. use Eccube\Controller\AbstractController;
  14. use Eccube\Event\EccubeEvents;
  15. use Eccube\Event\EventArgs;
  16. use Eccube\Form\Type\SearchProductBlockType;
  17. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  18. use Symfony\Component\HttpFoundation\Request;
  19. use Symfony\Component\HttpFoundation\RequestStack;
  20. use Symfony\Component\Routing\Annotation\Route;
  21. class SideSearchController extends AbstractController
  22. {
  23.     /**
  24.      * @var RequestStack
  25.      */
  26.     protected $requestStack;
  27.     public function __construct(
  28.         RequestStack $requestStack
  29.     ) {
  30.         $this->requestStack $requestStack;
  31.     }
  32.     /**
  33.      * @Route("/block/side_serch", name="block_side_serch", methods={"GET"})
  34.      * @Template("Block/side_serch.twig")
  35.      */
  36.     public function index(Request $request)
  37.     {
  38.         $builder $this->formFactory
  39.             ->createNamedBuilder(''SearchProductBlockType::class)
  40.             ->setMethod('GET');
  41.         $event = new EventArgs(
  42.             [
  43.                 'builder' => $builder,
  44.             ],
  45.             $request
  46.         );
  47.         $this->eventDispatcher->dispatch($eventEccubeEvents::FRONT_BLOCK_SEARCH_PRODUCT_INDEX_INITIALIZE);
  48.         $request $this->requestStack->getMainRequest();
  49.         $form $builder->getForm();
  50.         $form->handleRequest($request);
  51.         return [
  52.             'form' => $form->createView(),
  53.         ];
  54.     }
  55.     /**
  56.      * @Route("/block/side_serch_buy", name="block_side_serch_buy", methods={"GET"})
  57.      * @Template("Block/side_serch_buy.twig")
  58.      */
  59.     public function index2(Request $request)
  60.     {
  61.         $builder $this->formFactory
  62.             ->createNamedBuilder(''SearchProductBlockType::class)
  63.             ->setMethod('GET');
  64.         $event = new EventArgs(
  65.             [
  66.                 'builder' => $builder,
  67.             ],
  68.             $request
  69.         );
  70.         $this->eventDispatcher->dispatch($eventEccubeEvents::FRONT_BLOCK_SEARCH_PRODUCT_INDEX_INITIALIZE);
  71.         $request $this->requestStack->getMainRequest();
  72.         $form $builder->getForm();
  73.         $form->handleRequest($request);
  74.         return [
  75.             'form' => $form->createView(),
  76.         ];
  77.     }
  78. }