I have a url that looks like this:
/controller/action?query=foobar
In my paginator view script, I am calling the URL view helper to add the page number to the url:
<a href="<?php echo $this->url(array('page' => $this->next), null, false); ?>">
Passing false
should make it so that the URL is not reset, but the URL being generated does not include the original query parameter:
/controller/action/page/2
...and it should be:
/controller/action/page/2?query=foobar
What am I doing wrong?
You will have to add the query string to the end of the URL that is created by the Helper. The helper's job is to create links based on defined routes. It will not maintain query strings because no route in Zend has a query string.
<a href="<?php echo $this->url(array('page' => $this->next), null, false); ?>?<?php echo $_SERVER['QUERY_STRING'];?>">