I just ran a quick test using a simple route, and my assumption was correct
-- the wildcard params keep the order that was supplied:

echo $view->url(array('foo' => 'bar', 'derp' => 'doo'));
// /index/index/foo/bar/derp/doo

echo $view->url(array('derp' => 'doo', 'foo' => 'bar'));
// /index/index/derp/doo/foo/bar

So in theory a ksort should work.

--
*Hector Virgen*
Sr. Web Developer
Walt Disney Parks and Resorts Online
http://www.virgentech.com



On Wed, Oct 20, 2010 at 11:54 AM, Hector Virgen <[email protected]> wrote:

> Named parameters (such as "module", "controller" and "action" in the
> "default" route) should not be affected by the ksort, but anything that is
> handled by "*" should (in your case, the name1 and name2 keys). Again, I
> didn't test the code, but if it doesn't work that way I'd be surprised.
>
> --
> *Hector Virgen*
> Sr. Web Developer
> Walt Disney Parks and Resorts Online
> http://www.virgentech.com
>
>
>
> On Wed, Oct 20, 2010 at 11:48 AM, Fozzyuw <[email protected]> wrote:
>
>>
>> Hi Hector,
>>
>> Thanks for the tip about helpers.
>>
>> One item of note, ksorting doesn't actually do anything when passing it
>> to:
>> "$router->assemble($urlOptions, $name, $reset, $encode);"
>>
>> If that doesn't make sense, here's the thing, the URL helper code is
>> simply
>> this:
>>
>> ----
>> $router = Zend_Controller_Front::getInstance()->getRouter();
>> return $router->assemble($urlOptions, $name, $reset, $encode);
>> ----
>>
>> tossing a ksort between them doesn't effect the order in which the
>> $router->assemble() generates the URL.  I've just cracked open
>> "/Zend/Controller/Router/Route.php" to see how the assemble() function
>> works, but there's a bit more going on in there in terms of having logic
>> for
>> handling translations and partials, which I'm not familiar with.
>>
>> So, I'm trying to digest what's going on there to figure out if there's a
>> "Zend" way of doing it or if I simply have to create my own URL helper
>> that
>> generates the URL, and skip trying to use Router->Route.
>>
>>
>>
>> --
>> View this message in context:
>> http://zend-framework-community.634137.n4.nabble.com/Generating-URL-s-View-Helper-Action-Helper-tp3002936p3004397.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>
>

Reply via email to