title: The most reliable way of specifying new REST routes for custom actions in yii\web\UrlManager configuration
body: <p>I have created a standard <a href="https://www.yiiframework.com/doc/api/2.0/yii-rest-activecontroller" rel="nofollow noreferrer"><code>yii\rest\ActiveController</code></a> and added my custom action to it:</p>
  <pre><code>public function actionTest($id)
  {
      return ['test' =&gt; $id];
  }
  </code></pre>
  <p>To make it work, I have added a new entry to <code>extraPatterns</code> of <code>rules</code> of <a href="https://www.yiiframework.com/doc/api/2.0/yii-web-urlmanager" rel="nofollow noreferrer"><code>yii\web\UrlManager</code></a>:</p>
  <pre><code>'extraPatterns' =&gt; [
      'GET test/{id}' =&gt; 'test',
  ],
  </code></pre>
  <p>Tested, all OK. Then I wanted to support <code>POST</code> verb for this route, so I added another entry:</p>
  <pre><code>'rules' =&gt; [
      [
          'class' =&gt; 'yii\rest\UrlRule',
          'controller' =&gt; 'user',
          'pluralize' =&gt; false,
          'except' =&gt; ['index'],
          'extraPatterns' =&gt; [
              'GET test/{id}' =&gt; 'test',
              'POST test/{id}' =&gt; 'test',
          ],
      ],
  </code></pre>
  <p>Then <code>DELETE</code> and <a href="https://stackoverflow.com/a/36301716/1469208">so on</a>. And... there must be something that I am doing really wrong, because for:</p>
  <ul>
  <li>Six methods: <code>POST</code>, <code>GET</code>, <code>PUT</code>, <code>PATCH</code>, <code>OPTIONS</code> and <code>DELETE</code> per each custom action</li>
  <li>Five different actions per each controller and</li>
  <li>Seven REST controllers</li>
  </ul>
  <p>I'll end up with my main configuration file growing to... 6 * 5 * 7 = 210 lines?</p>
  <p>So, what is in Yii 2 the best / the most reliable way of making sure that every custom action in every REST controller will be accessible for every method / verb and not making this by growing configuration file by hundreds of lines?</p>