Routes won't work when I install composer and use autoloading option? : <p>When I install composer and set autoloading option and then click on my links other than home page I get this error  'Fatal error: Uncaught Error: Class 'homeController' not found in C:\xampp\htdocs\gacho\app\core\Application.php:13 Stack trace: #0 C:\xampp\htdocs\gacho\public\index.php(16): Application->__construct() #1 {main} thrown in C:\xampp\htdocs\gacho\app\core\Application.php on line 13 ', but link to home page works just fine. Here is my code structure and code: </p>

<p>code structure</p>

<pre><code> gacho
  |-app
     |- controller
     |- core
     |- model
     |- view
  |-public
     |-vendor
       |-composer
          |- autoload_classmap.php
       |- autoload.php
     |- .htaccess
     |- composer.json
     |- index.php
</code></pre>

<p>.htaccess</p>

<pre><code>RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^ index.php [QSA,L]
</code></pre>

<p>composer.json</p>

<pre><code>{
  "autoload": {
    "classmap":[
      "../app"
    ]
  }
}
</code></pre>

<p>autoload_classmap</p>

<pre><code>$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
  'App\\Controller\\HomeController' =&gt; $baseDir . 
  '/../app/controller/HomeController.php',
  'App\\Core\\Application' =&gt; $baseDir . '/../app/core/Application.php',
  'App\\Core\\Controller' =&gt; $baseDir . '/../app/core/Controller.php',
  'App\\Core\\Database' =&gt; $baseDir . '/../app/core/Database.php',
  'App\\Core\\View' =&gt; $baseDir . '/../app/core/View.php',
  'App\\Model\\User' =&gt; $baseDir . '/../app/model/User.php',
);
</code></pre>

<p>index.php</p>

<pre><code>define('ROOT', dirname(__DIR__) . DIRECTORY_SEPARATOR);
define('APP', ROOT . 'app' . DIRECTORY_SEPARATOR);
define('CONTROLLER', ROOT . 'app' . DIRECTORY_SEPARATOR . 'controller' . 
DIRECTORY_SEPARATOR);
define('VIEW', ROOT . 'app' . DIRECTORY_SEPARATOR . 'view' . 
DIRECTORY_SEPARATOR);
define('MODEL', ROOT . 'app' . DIRECTORY_SEPARATOR . 'model' . 
DIRECTORY_SEPARATOR);
define('CORE', ROOT . 'app' . DIRECTORY_SEPARATOR . 'core' . 
DIRECTORY_SEPARATOR);

$modules = [ROOT, APP, CORE, CONTROLLER];

require_once __DIR__ . '\vendor\autoload.php';
new Application;
</code></pre>

<p>Application.php</p>

<pre><code>class Application
{
   protected $controller = 'HomeController';
   protected $action = 'index';
   protected $params = [];

   public function __construct()
   {
      $this-&gt;prepareURL();
      if (file_exists(CONTROLLER. $this-&gt;controller . '.php')) {
         $this-&gt;controller = new $this-&gt;controller;
         if (method_exists($this-&gt;controller, $this-&gt;action)) {
            call_user_func_array([$this-&gt;controller, $this-&gt;action], $this-&gt;params);
         }
      }
   }
</code></pre>
