You can do this using a good ol' query string:

/controller/action?sort[column1]=desc&sort[column2]=asc

You should be able to access those using the request object:

$sort = $this->_request->getParam('sort');

--
Hector


2009/12/10 WebCorp s.r.o. | Jan Juříček <[email protected]>

>  Hi,
>
>
>
> Is there a way to pass an associative array via URL to the request object?
>
>
>
> This /controller/action/arr/foo/arr/bar would be converted to $arr ==
> array("foo", "bar"); and I would like to pass something like
> /controller/action/arr[foo1]/bar/arr[foo2]/bar so I would have $arr == array
> ("foo1" => "bar", "foo1" => "bar")
>
>
>
> Reason is simple: I have a table, where table header is used among other
> things to sort the DB results. I want to be able to sort by multiple columns
> and I’m looking for a way how to tell my scripts that the first column
> should be sorted in DESC, the sekond one in ASC…
>
>
>
> So basically I need to create an URL, which would result in calling the
> $this->getRequest()->getParams() in my controller with result for example
> array('_sort' => array('column1' => 'desc', 'column2' => 'asc')); …
>
>
>
> Or is there a better approach on this issue?
>
>
>
> Thanks for your time
>
> *Regards*
>
> *Jan***
>

Reply via email to