title: Yii2 module (not under /vendor folder) class not found in config/main.php
body: <p>I've created a module under folder api (which itself is same level as backend &amp; frontend in yii2 advanced app).  </p>
  
  <p>Folder structure:</p>
  
  <blockquote>
    <p>api<br>
    -- common<br>
    ------ controllers<br>
    ------ models<br>
    -- config<br>
    -- modules<br>
    ------ v1<br>
    ---------- controllers<br>
    ---------- models<br>
    -- runtime<br>
    -- tests<br>
    -- web  </p>
  </blockquote>
  
  <p>In api/config/main.php:</p>
  
  <pre><code>return [
  'id' =&gt; 'app-api',
  'basePath' =&gt; dirname(__DIR__),    
  'bootstrap' =&gt; ['log'],
  'modules' =&gt; [
      'v1' =&gt; [
          'basePath' =&gt; '@app/modules/v1',
          'class' =&gt; 'api\modules\v1\Module'
      ]
  ],
  </code></pre>
  
  <p>I get error:</p>
  
  <blockquote>
    <p>ReflectionException</p>
    
    <p>Class api\modules\v1\Module does not exist</p>
  </blockquote>
  
  <p>The class is definitely there.</p>
  
  <p>I've run a composer dumpautoload (no errors).</p>
  
  <p>urlManager in config/main.php:</p>
  
  <pre><code>'urlManager' =&gt; [
          'enablePrettyUrl' =&gt; true,
          'enableStrictParsing' =&gt; true,
          'showScriptName' =&gt; false,
          'rules' =&gt; [
                'v1/site/index' =&gt; 'v1/site/index', //module/controller/action
          ],        
      ]
  </code></pre>
  
  <p>Any help much appreciated,</p>
  
  <p>thanks</p>