How to inject dependencies into Yves controller?

89 Views Asked by At

I know that an instance of \Symfony\Component\HttpFoundation\Request can be injected into Yves controller action method. I know also that a path parameter can be also injected into controller action method. Is there a way to use constructor- or method-injection for the services needed in controller? Or using factory is the only way to get required dependencies into Yves controller?

1

There are 1 best solutions below

0
Tomasz Ferfecki On BEST ANSWER

I would say that using factory is the correct way for it. And it won't become problematic in future.

Any other option might become hack that will make Spryker upgrade problematic and time consuming.