title: URL routing rules in Yii2
body: <p>Coming from background of Laravel and Rails I am finding quite a difficulty to figure out how Yii2 rules work.</p>
  
  <p>I am looking for following URL patterns:</p>
  
  <ul>
  <li>/articles/</li>
  <li>/articles/view/</li>
  <li>/articles/1/my-pretty-article</li>
  </ul>
  
  <p><code>ArticlesController</code> is defined like:</p>
  
  <pre><code>&lt;?php
  
  namespace app\controllers;
  
  class ArticlesController extends \yii\web\Controller
  {
      public function actionIndex()
      {
          return $this-&gt;render('index');
      }
      public function actionView()
      {
          return $this-&gt;render('index');
      }
  
  }
  </code></pre>
  
  <p>So far I have tried:</p>
  
  <pre><code>'urlManager' =&gt; [
              'showScriptName' =&gt; false,
              'enablePrettyUrl' =&gt; true,
              'rules' =&gt;
                  [
                      'articles/view' =&gt; 'article/view'
                  ],
          ],
  </code></pre>
  
  <p>I am more interested to redirect my pattern to controller@method.</p>