저는 페이지 된 결과 셋을 만들기 위해 Zend \ Paginator를 사용하고 있습니다. 그러나 검색 양식을 추가 한 후에는 제대로 작동하지 않습니다.ZF2의 페이지 매김 URL에 쿼리 매개 변수를 저장하려면 어떻게해야합니까?
페이지의 검색 양식에 의해 생성 된 URL은 다음과 같습니다 그것은 생산의 URL에서 SEARCHTERM을 유지하도록
user/index/?searchTerm=hello
어떻게 젠드 매기기 구성을 수정합니까? 내가 실종 무엇
user/index/page/4/?searchTerm=hello
:
내가 좋아하는 뭔가를 기대했다?
echo $this->paginationControl(
$this->users, 'sliding', array('paginator', 'User'), array('route' => 'user', 'action' => 'index')
);
매김 템플릿 단편 :
<li>
<a href="<?php echo $this->url($this->route, array('action' => $this->action, 'page' => $this->next), true); ?>">
Next »
</a>
</li>
'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,
),
// the below was added to try and get the searchTerm query to be retained
'may_terminate' => true,
'child_routes' => array(
'searchTerm' => array(
'type' => 'Query',
),
),
),
),
는 페이징 뷰 이것을 이용하여 구성되어 다음과 같이
모듈 구성 경로가 정의되고
(나는 느낌은 true
을 third parameter to url()
would retain the query params으로 표시합니다.