ZF-10712: Assemble doesn't appends new parameters at the end of a url

Issue Type: Improvement Created: 2010-11-19T06:07:31.000+0000 Last Updated: 2012-11-20T21:37:45.000+0000 Status: Open Fix version(s): Reporter: 2called-chaos (2called-chaos) Assignee: None Tags: - Zend_Controller_Router

Related issues: Attachments:


I noticed that the URL-view-helper doesn't work as expected (in my opinion) as it doesn't append new variables to the end of a URL. It adds new variables at the beginning of the parameters part of the url, an example:

If I have a current URL like {quote}… {quote} and use the URL-view-helper in this way: {quote} url('param2' => 'value2'); ?> {quote} the url is {quote}… {quote} instead of {quote}… {quote}

I think the last URL is the expected result (appending new variables to the end)...

As I needed this behavior I searched for a solution and found one in Zend_Controller_Router_Route::assemble on line 374 (in v1.11.0)...

Replacing {quote} if (!$reset) $data += $this->_wildcardData; {quote} with {quote} if (!$reset) $data = $this->_wildcardData + $data; {quote} solves the problem. But I don't know if this is really a bug or a feature and if this is the best way to solve that...




Posted by Matthew Weier O'Phinney (matthew) on 2010-11-19T06:40:42.000+0000

Why does the order matter, exactly? These are key/value pairs, and order should not be an issue. Can you explain the use case?

Posted by 2called-chaos (2called-chaos) on 2010-11-19T09:26:05.000+0000

In my case it is a bit of aesthetics and sense... {quote} /payment/select/pay-method/for-product/foo/with-addons/bar,baz {quote} makes more sense and looks better than {quote} /payment/select/pay-method/with-addons/bar,baz/for-product/foo {quote}

Just my opinion but I think it's intuitive or expected that new things will be appended instead of be placed anywhere in the middle...



Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.