title: Slim 3 autoloader
body: <p>I'm new to slim framework, and can't figure out how to use the autoloader to autoload my classes.</p>
  
  <p>I created a <code>app/models/myclass.php</code>  but of course when I try to use it I get a class not found. I'm not sure which is the right way to autoload classes, or the naming convensions I should use. Should I do it via the composer.json somehow? I'm searching the net for several hours without any solid answer on that. </p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>Managed to do it like that:</p>
  
  <ul>
  <li>added model in : app/src/Model/Client.php</li>
  <li>added <code>namespace App\Model;</code> in Client.php</li>
  <li>added the following in depedencies.php:</li>
  </ul>
  
  <pre class="lang-php prettyprint-override"><code>$container['App\Model\Client'] = function ($c) {
      return new App\Model\Client();
  };
  </code></pre>
  
  <p>and routes.php:</p>
  
  <pre class="lang-php prettyprint-override"><code>$app-&gt;get('/client/ping/{id}',  function ($request, $response, $args)  {
      $container = $this-&gt;getContainer();
      $client=$container['App\Model\Client']; //instantiates a new Client
      ...
      ...
  }
  </code></pre>