mzfp Posted July 1, 2020 Share Posted July 1, 2020 I'm currently developing a custom module for Prestashop and because Prestashop 1.7 is now based on Symfony I am investing some extra time in using the Symfony platform as much as possible rather than using plain old php or Prestashop libraries. Prestashop now provides a way to obtain a container to Symfony services which can be used anywhere in a module. I am attempting to use this access the Symfony\Component\HttpFoundation\Request services but without luck. Below is what I have tried so far: $request = $this->container->get('symfony.component.httpfoundation.request'); and also $request = $this->container->get('request'); but both result in the error: You have requested a non-existent service Is it possible to use Request service via the container? Kind Regards Musaffar Link to comment Share on other sites More sharing options...
Ali Samie Posted August 9, 2022 Share Posted August 9, 2022 I wonder why there is no answer to these questions in community. I am searching a lot for this and I could not solve my issue too. I need to load this service "prestashop.adapter.address.query_handler.get_customer_address_for_editing_handler" Link to comment Share on other sites More sharing options...
Damian Posted October 26, 2022 Share Posted October 26, 2022 In "legacy environment" (module class, front, legacy admin) you don't have access to symfony container. See https://devdocs.prestashop-project.org/1.7/modules/concepts/services/#services-in-legacy-environment 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now