I use Zend \ Paginator to build a result set of results. This works great, however, adding a search form, I can not get them to play together.
URL generated by the search form on the page:
user/index/?searchTerm=hello
How do I change the paginator Zend configuration so that it saves searchTerm in the resulting URLs?
I was hoping for something like:
user/index/page/4/?searchTerm=hello
What am I missing?
The module configuration route is defined as follows:
'user' => array( 'type' => 'Zend\Mvc\Router\Http\Segment', 'options' => array( 'route' => '/user[/[:action[/]]][[id/:id]][/[page/:page]]', 'defaults' => array( 'controller' => 'Application\Controller\User', 'action' => 'index', 'id' => null, ),
Page breaks are built using this in a view:
echo $this->paginationControl( $this->users, 'sliding', array('paginator', 'User'), array('route' => 'user', 'action' => 'index') );
A fragment of the pagination template:
<li> <a href="<?php echo $this->url($this->route, array('action' => $this->action, 'page' => $this->next), true); ?>"> Next » </a> </li>
(I had the impression that passing true as the third url() parameter would save the request parameters .)