Issue Type: Improvement Created: 2009-09-02T07:32:45.000+0000 Last Updated: 2012-11-20T21:37:57.000+0000 Status: Open Fix version(s): Reporter: Alex Zinchenko (admloki) Assignee: None Tags: - Zend_Controller
Related issues: Attachments:
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'))).
Posted by Wil Moore III (wilmoore) (wilmoore) on 2010-07-06T23:46:04.000+0000
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?
Have you found an issue?
See the Overview section for more details.