Skip to content

Instantly share code, notes, and snippets.

Avatar

Zeid Rashwani zrashwani

View GitHub Profile
View paginator.html.twig
{% set first = 1%}
{% set previous = max(range(1, current-1)) %}
{% set last = pagesNumber %}
{% set next = min( last, current+1 ) %}
{% set pages_range = range(max(first, current-3), min(last, current+3)) %}
{% if pagesNumber > 1 %}
{%set first = 1 %}
{%set last = pagesNumber %}
{%set query= {} %}