webcustoms / enlight-symfony-wrapper
Allows the use of Symfony 3 controllers within Shopware plugins.
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 5
Forks: 0
Open Issues: 0
pkg:composer/webcustoms/enlight-symfony-wrapper
Requires
- symfony/routing: ~3.4.15
This package is not auto-updated.
Last update: 2025-12-28 15:45:43 UTC
README
What does it do?
It allows you to use the Route annotation tags provided by the Symfony framework within your Shopware plugins.
Installation
composer require webcustoms/enlight-symfony-wrapper
Example usage
See the example directory for a working example.
How do I
... implement CSRFWhitelistAware?
Simply implement it in your class definition, and we'll pick it up.
... generate URLs to my action?
$this->container->get('router')->assemble([ 'module' => 'Your\Name\Space', // optional if it's the current one 'controller' => 'YourClassName', // optional if it's the current one 'action' => 'yourMethodName' ]);
or
$this->container->get('router')->assemble([ // You can also set 'route' directly, either the auto-generated // name from Symfony, or the "name" attribute you set manually // for your route. 'route' => 'your_name_space.your_class_name.your_method_name' ]);
... do something on preDispatch or postDispatch?
By subscribing to KernelEvents as described in the article How to Set Up Before and After Filters by Symfony.
The following Shopware-like events are notified, in this order:
Enlight_Controller_Action_PreDispatchEnlight_Controller_Action_PreDispatch_Backend(or_Api,_Frontend,_Widgetsdepending on the URL)Enlight_Controller_Action_PreDispatch_MyNameSpace\MyController(which won't be that helpful)Enlight_Controller_Action_Backend_WebcustomsEnlightSymfonyWrapperComponentsControllerWrapper_MyMethodNamePreDispatch_mynamespace_mycontroller_myactionPreDispatch_MyNameSpace\MyController::MyActionDispatch_mynamespace_mycontroller_myaction(notifyUntil)Dispatch_MyNameSpace\MyController::MyAction(notifyUntil)PostDispatchSecure_mynamespace_mycontroller_myactionPostDispatchSecure_MyNameSpace\MyController::MyActionPostDispatch_mynamespace_mycontroller_myactionPostDispatch_MyNameSpace\MyController::MyActionEnlight_Controller_Action_PostDispatchSecure_MyNameSpace\MyControllerEnlight_Controller_Action_PostDispatchSecure_Backend(or_Api,_Frontend,_Widgetsdepending on the URL)Enlight_Controller_Action_PostDispatchSecureEnlight_Controller_Action_PostDispatch_MyNameSpace\MyControllerEnlight_Controller_Action_PostDispatchS_Backend(or_Api,_Frontend,_Widgetsdepending on the URL)Enlight_Controller_Action_PostDispatch