<div class="pagination">
{% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
<li>
- <a href="{{ path(app.request.attributes.get('_route'), {'page': p}) }}" class="{{ currentPage == p ? 'current':''}}" >{{ p }}</a>
+ <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}" class="{{ currentPage == p ? 'current':''}}" >{{ p }}</a>
</li>
{% endfor %}
</div>
<ul class="pagination right">
{% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
<li class="{{ currentPage == p ? 'active':'waves-effect'}}">
- <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}" >{{ p }}</a>
+ <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}">{{ p }}</a>
</li>
{% endfor %}
</div>
$this->assertCount(1, $crawler->filter('div[class=entry]'));
}
+
+ public function testPaginationWithFilter()
+ {
+ $this->logInAs('admin');
+ $client = $this->getClient();
+
+ $crawler = $client->request('GET', '/config');
+
+ $form = $crawler->filter('button[id=config_save]')->form();
+
+ $data = array(
+ 'config[items_per_page]' => '1',
+ );
+
+ $client->submit($form, $data);
+
+ $parameters = '?entry_filter%5BreadingTime%5D%5Bleft_number%5D=&entry_filter%5BreadingTime%5D%5Bright_number%5D=';
+
+ $crawler = $client->request('GET', 'unread/list'.$parameters);
+
+ $this->assertContains($parameters, $client->getResponse()->getContent());
+ }
}