Development

Changeset 6125

You must first sign up to be able to contribute.

Changeset 6125

Show
Ignore:
Timestamp:
11/21/07 10:16:20 (1 year ago)
Author:
noel
Message:

sfRouting : allow numeric parameters (closes #2317)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/lib/controller/sfRouting.class.php

    r5845 r6125  
    456456    } 
    457457 
    458     $params = array_merge($defaults, $params); 
     458    $params = sfToolkit::arrayDeepMerge($defaults, $params); 
    459459 
    460460    $real_url = preg_replace('/\:([^\/]+)/e', 'urlencode($params["\\1"])', $url); 
  • branches/1.0/test/unit/controller/sfRoutingTest.php

    r4228 r6125  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(66, new lime_output_color()); 
     13$t = new lime_test(68, new lime_output_color()); 
    1414 
    1515// public methods 
     
    177177//$t->is($r->generate('', $params), $url, '->generate() removes last parameters if they have default values'); 
    178178 
     179// Numerics params 
     180$r->clearRoutes(); 
     181$r->connect('test', '/:module/:action/*', array('module' => 'default', 'action' => 'index')); 
     182$params = array('module' => 'default', 'action' => 'index', 15 => 'foo', 32 => 'bar', 'foo' => 'bar'); 
     183$url = '/default/index/15/foo/32/bar/foo/bar'; 
     184$t->is($r->parse($url), $params, '->parse() routes can have numeric parameters'); 
     185$t->is($r->generate('', $params), $url, '->generate() routes can have numeric parameters'); 
     186 
    179187// star parameter 
    180188$r->clearRoutes();