Answer the question
In order to leave comments, you need to log in
How to install extension from gitHub to yii2?
The question seems silly, but I honestly can't figure it out =)))
How to add GuzzleHttp to yii2?
I'm confused by the slash before the class name \ GuzzleHttp. If not for him, I would have thrown everything into "vendor" from GitHub, added alias to extensions.php, and used it. And so, with this slash, it searches not for this alias, but at the root ... I don’t understand where to put all this =) Please explain ....
This is the part of the code where this GuzzleHttp is required
$this->client = new \GuzzleHttp\Client([
"base_uri" => $baseUrl,
"headers" => $headers,
"timeout" => Settings::TIMEOUT_SEC
]);
Answer the question
In order to leave comments, you need to log in
Use the "Installing Guzzle" section of your link.
In the console from the project folder, we execute
composer require guzzlehttp/guzzle
Use:
use GuzzleHttp\Client;
$this->client = new Client([
"base_uri" => $baseUrl,
"headers" => $headers,
"timeout" => Settings::TIMEOUT_SEC
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question