Reputation: 238647
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?
Upvotes: 1
Views: 845
Reputation: 106
You'd better use the following format of the URL:
/controller/action/query/foobar
That should be compatible with the URL helper non-reset functionality and your code should work.
Upvotes: 0
Reputation: 2256
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'];?>">
Upvotes: 3