title: How to use Twig template engine with Yii2 framework?
body: <p>I followed the instructions on yii2 documentation about using twig template engine</p>
  
  <p>in config/web.php (which is included from index.php) I have:</p>
  
  <pre><code>'view' =&gt; [
              'class' =&gt; 'yii\web\View',
              'renderers' =&gt; [
                  'twig' =&gt; [
                      'class' =&gt; 'yii\twig\ViewRenderer',
                      'cachePath' =&gt; '@runtime/Twig/cache',
                      'options' =&gt; ['auto_reload' =&gt; true], /*  Array of twig options */
                      'globals' =&gt; ['html' =&gt; '\yii\helpers\Html'],
                  ],
              ],
          ],
  </code></pre>
  
  <p>in SiteController.php:</p>
  
  <pre><code>public function actionIndex()
      {
          echo $this-&gt;render('index.twig');
      }
  </code></pre>
  
  <p>in views/site/index.twig I have some text:</p>
  
  <p>But instead of seeing raw html I see template based on <code>views/layouts/main.php</code> with index.twig content used as variable in main layout.</p>