Class not found in namespace

0

I'm trying to use a class by using the namespace, but it always generates this error:

  

Fatal error: Uncaught Error: Class 'Database\connect' not found in /opt/lampp/htdocs/Estudando/app/Usuario/Controller/usuarioController.php:13 Stack trace: #0 /opt/lampp/htdocs/Estudando/index.php(11): app\Usuario\Controller\usuarioController->nome() #1 {main} thrown in /opt/lampp/htdocs/Estudando/app/Usuario/Controller/usuarioController.php on line 13

My composer looks like this:

{
    "autoload" : {
      "psr-4":{
        "app\":"app",
        "Database\":"Database"
      }
    },
    "require": {
        "twig/twig": "^2.4"
    }
}

The class I want to instantiate is this way:

namespace Database;

  class connect {
     ....
  }

And this is the class I'm calling:

namespace app\Usuario\Controller;
use \app\Usuario\Views\usuarioView;
use Database\connect;

  class usuarioController {
    public function nome(){
    }
  }

I can use the namespaces of the app / quiet path, but now that I needed to add the database / I'm not getting ...

    
asked by anonymous 07.10.2017 / 16:20

0 answers