For example, if I have the following block of code in my config file:

$routes['webservice'] = new Zend_Controller_Router_Route(
    'web-service/timeline/:response/:user/:count/:callback/*',
    array(
        'response'   => 'json',
        'user'       => null,
        'count'      => 10,
        'callback'   => 'callback',
    )
);


Everything works fine. And I can retrieve the value of user within my
controller using $this->_getParam('user'). Now, I add validation to that
specific route, then all the key=>value pairs get messed up. For example:


$routes['webservice'] = new Zend_Controller_Router_Route(
    'web-service/timeline/:response/:user/:count/:callback/*',
    array(
        'response'   => 'json',
        'user'       => null,
        'count'      => 10,
        'callback'   => 'callback',
    ),
    array(
        'count'      => '\d+',
    )
);


In the first example, the router does what I want:
http://example/controller/action/value/value/value/value

In the second example, it messes everything up an converts the values to
key/value pairs: http://example/controller/action/key/value/key/value

This is something that shouldn't take more than a minute to setup, and today
I spent all day trying to understand the logic behind this, and couldn't
figure it out. 

Any idea? Is this is a bug?




-- 
View this message in context: 
http://www.nabble.com/Adding-validation-to-a-route%2C-is-this-a-bug--tp21098392p21098392.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to