title: Yii2: Menu active in different controllers
body: <p>This is my code:</p>
  
  <pre><code>&lt;?=
       Nav::widget([
            'options' =&gt; ['class' =&gt;'nav-pills nav-stacked'],
            'encodeLabels' =&gt; false,
            'items' =&gt; [
                     [
                      'label' =&gt; 'Blog',
                      'url' =&gt; ['/blog'],
                      'active' =&gt; \Yii::$app-&gt;controller-&gt;id == 'blog'
                     ],
            ],
       ]);
  ?&gt;
  </code></pre>
  
  <p>But I want this menu is active not only when the controller is "blog", but also when it is "category" and "post".</p>