{% if pagination.nbPages > 1 %}
<section class="section-pagination">
<ul class="pagination">
{% if pagination.page > 1 %}
<!--li>
<a href="{{ path(pagination.nomRoute, pagination.paramsRoute|merge({'page': 1})) }}">
<<
</a>
</li-->
<li class="pagination_prev">
<a href="{{ path(pagination.nomRoute,
pagination.paramsRoute|merge({'page': pagination.page-1})) }}">
<
</a>
</li>
{% endif %}
{# Affichage de toutes les pages entre p-4 et p+4 sauf si < 1 ou > nbPages #}
{% for p in range(max(pagination.page-4, 1), min(pagination.page+4, pagination.nbPages)) %}
<li {% if p == pagination.page %}class="active"{% endif %}>
<a href="{{ path(pagination.nomRoute, pagination.paramsRoute|merge({'page': p})) }}">
{{ p }}
</a>
</li>
{% endfor %}
{% if pagination.page < pagination.nbPages %}
<li class="pagination_next">
<a href="{{ path(pagination.nomRoute,
pagination.paramsRoute|merge({'page': pagination.page+1})) }}">
>
</a>
</li>
<!--li>
<a href="{{ path(pagination.nomRoute,
pagination.paramsRoute|merge({'page': pagination.nbPages})) }}">
>>
</a>
</li-->
{% endif %}
</ul>
</section>
{% endif %}