PHP Classes

File: src/Resources/views/Pagination/paginate.html.twig

Recommend this page to a friend!
  Classes of Cedrick Oka   OKA Symfony Pagination Twig   src/Resources/views/Pagination/paginate.html.twig   Download  
File: src/Resources/views/Pagination/paginate.html.twig
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: OKA Symfony Pagination Twig
Bundle for pagination support using Twig templates
Author: By
Last change:
Date: 4 years ago
Size: 857 bytes
 

Contents

Class file image Download
{% if context.pageNumber > 1 %} <ul class="pagination" data-page-number="{{ context.pageNumber }}"> {# Preview Button #} {% if context.page > 1 %} {% set previewParams = params|merge({'page': (context.page - 1)}) %} <li class="arrow"><a href="{{ path(route, previewParams) }}">&laquo;</a></li> {% endif %} {# Middle #} {% for i in 1..context.pageNumber %} {% set params = params|merge({'page': i}) %} {% if context.page == i %} <li><a href="#" class="current">{{ i }}</a></li> {% else %} <li><a href="{{ path(route, params) }}" data-page="{{ i }}">{{ i }}</a></li> {% endif %} {% endfor %} {# Next Button #} {% if context.page < context.pageNumber %} {% set nextParams = params|merge({'page': (context.page + 1)}) %} <li class="arrow"><a href="{{ path(route, nextParams) }}">&raquo;</a></li> {% endif %} </ul> {% endif %}