title: How to change default view path in Yii2?
body: <p>I am trying to do multi theme in advanced-yii2.
  I tried a lot of way for this but it doesn't work I can't understand.
  Firstly, I added this to "frontend/config/main.php";</p>
  
  <pre><code>          'view' =&gt; [
                'theme' =&gt; [
                   'pathMap' =&gt; [ 
                      '@app/views' =&gt; [ 
                          '@webroot/themes/demo/views',
  
                       ]
                   ],
                 ],
              ],
  </code></pre>
  
  <p>and it doesn't work, then I tried to creating a new view class for frontend, for example:</p>
  
  <pre><code>    namespace frontend\components;
  
  class NewsView extends \yii\web\View {
  
      function init() {
      \Yii::$app-&gt;view-&gt;viewPath = '@webroot/themes';
      parent::init();
      }
  
  }
  </code></pre>
  
  <p>and added in config.php</p>
  
  <pre><code>'view' =&gt; [
          'class' =&gt; 'frontend\components\NewsView',
  </code></pre>
  
  <p>but it doesn't work too.</p>
  
  <p>What should I do?</p>