title: getUrlRules - switch to controller
body: <p>I have a SearchModule.php has the following:</p>
  
  <pre><code>class SearchModule extends CWebModule
  {    
      // function init() { }
      /**
       * @return array Правила роутинга для текущего модуля
       */
      function getUrlRules()
      {
          $customController = (Yii::app()-&gt;theme-&gt;getName() == 'test' ? 'Test' : '') . '&lt;controller&gt;';
  
          return array(
              $this-&gt;id.'/&lt;controller:\w+&gt;/&lt;action:(SupportBlock)&gt;/&lt;countryId:\d+&gt;' =&gt; $this-&gt;id.'/' . $customController . '/&lt;action&gt;',
              $this-&gt;id.'/&lt;controller:\w+&gt;/&lt;action:(SupportBlock)&gt;/&lt;countryId:\d+&gt;/&lt;cityId:\d+&gt;' =&gt; $this-&gt;id.'/' . $customController . '/&lt;action&gt;',
              $this-&gt;id.'/visas' =&gt; $this-&gt;id.'/visas/fullVisasInfo',
          );
      }
  }
  </code></pre>
  
  <p>What I'm trying to figure out is how to use another controller IF my theme' set to 'test'. Right now it has search controllers named like HotelsController or LocationsController. What I'm trying to achieve is if theme' name set to "test", it should route all requests to TestHotelsController or TestLocationsController from the SAME URL (/search/hotels should route to TestHotelsController instead of HotelsController). </p>
  
  <p>I have tried doing it by appending 'Test' to the second part of routing table, but that didn't seem to do anything.</p>