Jump to content

Using Symfony Request service in Prestashop module


mzfp

Recommended Posts

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

  • 2 years later...

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

  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...