ZF-7760: Default values for router should contain arrays.


I think default values for router should contain arrays. For example, in Zend_Rest_Route due to assemble() return values, "url" view helper returns incorrect data.

E.g. current page is /page/1, so $this->url(array('id' => 2)); in view will return /page/get/2 instead of /page/2 if i will use my patch (see ZF-7753) for Zend_Rest_Route. Otherwise, $this->url(array('id' => 2)) will return correct values, instead of $this->url(array('id' => 2, 'action' => 'edit')).

The problem is every single route class uses its own assemble() method to return compiled url, and i can't to develop "elegant" solution to solve this problem.

In my opinition, routers should accepts arrays for default values, like $rest = new Zend_Rest_Route($front, array('action' => array('index', 'get'))).

Any ideas?



If I understand your request, you are asking for:

A way to ensure that writing $this->url(array('id' => 2)) always returns /page/get/2 (since you provided the 'url' method with an id). Also, if not given an id $this->url(), /page/index (or /page) is returned?

Is this what you are after?