how to correctly configure Guzzle with symfony2?

0

Good morning.

What I am trying to do is to have the client with php, so I decided to use this library (Guzzle), which allows me to consume web services type rest from php.

I have already followed the documentation but I get this error:

Attempted to load class "Client" from namespace "GuzzleHttp". Did you forget to "use" statement for e.g. "Symfony \ Component \ HttpKernel \ Client", "Symfony \ Component \ BrowserKit \ Client", "Symfony \ Bundle \ FrameworkBundle \ Client", "Solarium \ Client" or "Solarium \ Core \ Client \ Client"? "

The library is already downloaded with composer, and add the "use GuzzleHttp \ Client" but nothing.

I also added it to the AppKernel.php like this:

new EightPoints\Bundle\GuzzleBundle\GuzzleBundle()

But when I do this I get this error:

ClassNotFoundException in AppKernel.php line 42: Attempted to load class "GuzzleBundle" from namespace "EightPoints \ Bundle \ GuzzleBundle". Did you forget to "use" statement for another namespace?

What is missing? Thank you in advance.

    
asked by devjav 14.07.2016 в 23:27
source

1 answer

0

add in your controller this link:

use \ Bundle \ GuzzleBundle \ Entity \ Client;

use \ Bundle \ GuzzleBundle \ Form \ ClientType;

    
answered by 20.07.2016 / 11:47
source