title: CakePHP 2.0 Router::connect how to pass named params
body: <p>I'm rebuilding a site in CakePHP 2.0 and need to route some old URLs to new ones. For example, this:</p>
  
  <p><a href="http://www.example.com/widget/helpbox/location/mackay-qld" rel="nofollow">http://www.example.com/widget/helpbox/location/mackay-qld</a></p>
  
  <p>Will route to this:</p>
  
  <p><a href="http://www.example.com/widgets/answer/location_id:10542" rel="nofollow">http://www.example.com/widgets/answer/location_id:10542</a></p>
  
  <p>In order to do this, I have the following route:</p>
  
  <pre><code>Router::connect(
      '/widget/helpbox/location/mackay-qld',
      array(
          'controller' =&gt; 'widgets',
          'action' =&gt; 'answer',
          'location_id' =&gt; 10542
      )
  );
  </code></pre>
  
  <p>When I debug $this->request->params, I get this:</p>
  
  <pre><code>Array
  (
      [plugin] =&gt; 
      [controller] =&gt; widgets
      [action] =&gt; answer
      [named] =&gt; Array
          (
          )
  
      [pass] =&gt; Array
          (
          )
  
      [location_id] =&gt; 10542
      [isAjax] =&gt; 
  )
  </code></pre>
  
  <p>But I expect this:</p>
  
  <pre><code>Array
  (
      [plugin] =&gt; 
      [controller] =&gt; widgets
      [action] =&gt; answer
      [named] =&gt; Array
          (
              [location_id] =&gt; 10542
          )
  
      [pass] =&gt; Array
          (
          )
  
      [isAjax] =&gt; 
  )
  </code></pre>
  
  <p>I've also tried calling</p>
  
  <pre><code>Router::connectNamed(array('location_id'));
  </code></pre>
  
  <p>...but to no avail. location_id is still passed in the same way - not as a named parameter.</p>
  
  <p>Does anyone know the correct syntax?</p>