Successfully connected Sylius Search to your project

https://github.com/Sylius/SyliusSearchBundle/blob/master/Controller/SearchController.php#L66 based on this line you can’t set your view from configs

when trying to inherit from this controller error

 Catchable Fatal Error: Argument 1 passed to Sylius\Bundle\ResourceBundle\Controller\ResourceController::__construct() must be an instance of Sylius\Bundle\ResourceBundle\Controller\Configuration, none given 

I don’t see a constructor in the controller. How to connect the specified bandl with my submission? How to work with bandles in principle? It seemed to me that the only true way of specifying the template in configs or inheriting

  • may need to edit the services - username
  • I would not use inheritance, since It is not known what the creator of the bundle did. The easiest way is to override the template itself in app/Resources/SyliusSearchBundle/views/Search/index.html.twig or in a similar way. - etki
  • I did not quite understand. You offer me to edit the vendors?) Or talking about the fact that there is a way to override bundles outside vendors - username
  • Do you have an app folder in vendors ? - etki
  • one

1 answer 1

on the advice of Etki got acquainted with

http://symfony.com/doc/current/book/templating.html#overriding-bundle-templates

in my case, I successfully redefined the search output like this:

 app/Resources/SyliusSearchBundle/views/index.html.twig 

since https://github.com/Sylius/SyliusSearchBundle/blob/master/Controller/SearchController.php#L66

  ->setTemplate('SyliusSearchBundle::index.html.twig') 

app/Resources/SyliusSearchBundle/views/Search/index.html.twig would be relevant if the path in the bundle controller was SyliusSearchBundle:Search:index.html.twig