How to use amphp with yii 2.0

Hello, i’m quite new to yii 2.0, I’m a fan of yii 1.1 !!

I have a requirement, and I want to test yii 2.0 , and I need to test amphp ( Asynchronous concurrency.

I create a basic web app , then I downloaded via composer : composer require amphp/artax

I see a folder below “vendor” with the name “amphp”…

But when I write this line in a new controller;

$client = new Amp\Artax\DefaultClient;

i get this error:

Class ‘app\controllers\Amp\Artax\DefaultClient’ not found

What I missing ?
What are all the folders in vendor ? ( newby question)

Best Regards

Check docs.

you missed a prefixed slash ():
correct would be:

new \Amp\Artax\DefaultClient;
1 Like