Skip to content

Instantly share code, notes, and snippets.

@brunodplima
brunodplima / pagination.html.twig
Created August 11, 2017 21:23 — forked from SimonSimCity/pagination.html.twig
A gist for pagination in Twig, based on the total number of pages, the current page and some URL-settings.
{#
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/
Updated by: Simon Schick <simonsimcity@gmail.com>
Parameters:
* currentFilters (array) : associative array that contains the current route-arguments
* currentPage (int) : the current page you are in
* paginationPath (string) : the route name to use for links
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled)
* lastPage (int) : represents the total number of existing pages
@brunodplima
brunodplima / Link.php
Last active October 26, 2016 21:48 — forked from weaverryan/Link.php
KnpUniversity Symfony REST: Using @link with the PaginatedCollection (http://knpuniversity.com/screencast/symfony-rest3/evaluating-expression)