title: Get modules structure in Yii2 Advanced Template
body: <p>In order to create a table to assing permissions I need to know the modules of my app (and controllers and acctions of each), of course I can use</p>
  
  <pre><code>    Yii::$app-&gt;modules
  </code></pre>
  
  <p>But it returns only loaded modules, and I want to make my permissions table in <code>backend</code> so I receive the common and <code>backend</code> modules (and it is OK) but not <code>frontend</code> ones (and this is the problem).</p>
  
  <p>Other approach should be <code>ModuleName::getInstance();</code> but I need the <code>ID</code> previously and what I want is scan all the present modules in common, <code>backend</code> and <code>frontend</code>.</p>
  
  <p>Any approach or suggestion are welcome. Thanks.</p>