How to setup Autoload with yii2?

I have founded a nice library to upload file.

This library is [size="2"]FlowJS and use Composer[/size]

Now i have readed the documentation for autoload external library

[size=“2”]But i don’t understand some step:[/size]

[size="2"]1) I have installed into path \[/size]vendor\flowjs the library

(for example, i see the file [size="2"]\[/size][size="2"]vendor\flowjs\[/size][size="2"]autoload.php[/size]

[size="2"]In attachment the zip file of Flow Js php server (installed via composer)[/size]

[size="2"]2) i have created a testController:[/size]

[size="2"]




<?php


namespace app\controllers;

use yii\flowjs;


class ProvaController extends \yii\web\Controller

{

    public function actionIndex()

    {

$tempDir = __DIR__ . DIRECTORY_SEPARATOR . 'temp';


//Path to autoload.php from current location

//require_once '../../vendor/autoload.php';


$config = new \Flow\Config();

$config->setTempDir($tempDir);

$file = new \Flow\File($config);

die('hello');

        return $this->render('index');

    }


}



[/size]

[size="2"]when try the controller i got this error:[/size]

Class ‘Flow\Config’ not found

Can you help me?

I haven’t done this before but there are a couple of things that I can notice.

  1. Your autoload section should have \\ at the end of the Flow namespace declaration

  2. src might have to have / at the end

3> Have you loaded the extension in your configuration (in modules)?