{% if offset is defined and count is defined %} {% if count > 0 %}
{% set route = app.request.attributes.get('_route') %} {% if 'page' not in route %} {% set route = route~'-page' %} {% endif %} {% if table_limit is not defined %} {% set table_limit = 20 %} {% endif %} {% set limit = (offset+1)*table_limit %} {% set currentPath = path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params')) %} {% if limit > count %} {% set limit = count %} {% endif %} {% if expanded is not defined %} {{ (offset*table_limit)+1 }} - {{ limit }} sur {{ count }} {% endif %} {% if (offset*table_limit)+1 > 1 %} {% set link = "" %} {% if cat is defined and cat %} {% set link = url(route,{'cat':cat,'offset':offset}) %} {% else %} {% set link = url(route,{'offset':offset}) %} {% endif %} {%if expanded is defined %} | Précédent{%endif%} {% else %} {%if expanded is defined %} | Précédent{%endif%} {% endif %} {% if expanded is defined %} {{ (offset*table_limit)+1 }} - {{ limit }} sur {{ count }} {% endif %} {% if limit < count %} {% set link = "" %} {% if cat is defined and cat %} {% set link = url(route,{'cat':cat,'offset':offset+2}) %} {% else %} {% set link = url(route,{'offset':offset+2}) %} {% endif %} {%if expanded is defined %}Suivant | {%endif%} {% else %} {%if expanded is defined %}Suivant | {%endif%} {% endif %}
{% else %} {% endif %} {% endif %}