yii2 route config for modules instead of controllers
<p>I'm in need to configure all of my models and controllers except SiteControllers as modules. I've managed to get simple views working, but can't get around with other controller actions.</p>

<p>To elaborate what I'm talking about, routes should be as following:</p>

<pre><code>example.com =&gt; app/site/index
example.com/page =&gt; app/modules/page/default/index
example.com/page/&lt;slug&gt; =&gt; app/modules/page/default/view/&lt;slug&gt;
example.com/submit/1 =&gt; app/modules/page/default/submit/1
</code></pre>

<p>The first three are working as they should, but what about the following? Current <code>urlManager</code> is:</p>

<pre><code>        'urlManager' =&gt; [
        'class' =&gt; 'yii\web\UrlManager',
        'showScriptName' =&gt; false,
        'enablePrettyUrl' =&gt; true,
        'rules' =&gt; [           
            '&lt;module:\w+&gt;/&lt;action:\w+&gt;' =&gt; '&lt;module&gt;/default/&lt;action&gt;/view',
            '&lt;module:\w+&gt;/&lt;controller:\w+&gt;' =&gt; '&lt;module&gt;/&lt;controller&gt;/index',
            '&lt;module:\w+&gt;/&lt;controller:\w+&gt;/&lt;action:\w+&gt;' =&gt; '&lt;module&gt;/&lt;controller&gt;/&lt;action&gt;',
            '&lt;module:\w+&gt;/&lt;controller:\w+&gt;/&lt;action:\w+&gt;/&lt;id:\w+&gt;' =&gt; '&lt;module&gt;/&lt;controller&gt;/&lt;action&gt;/view',
        ],
    ],
</code></pre>

<p>Thanks in advance!</p>