dev-master
9999999-dev https://github.com/poznet/Array-PaginatorSimple array pagination in view
MIT
The Requires
- php >=5.3
pagination array paginator array pagination
Simple array pagination in view
Simple Array Pagginator Bundle for Symfony 2, (*1)
As long as you paginate query elements ( using for example KNP Paginator Bundle ) there is no problem, but sometimes there is a need to paginate array elements in view., (*3)
I got problem with implementation KNPPaginatorBundle to paginate elements of array , so i created this., (*4)
Simple :
composer require poznet/arraypaginator
, (*5)
in parameters, (*6)
define how much element's you want to show on eah page :, (*7)
parameters: poznet_array_paginator: - perpage: 9
in Controller, (*8)
$tab=array(); $pagination=$this->get('poznet.array.paginator')->paginate($tab); return array('pagination'=>$pagination);
in View
- render array elements as normally ( foreach )
- in place where you want to have pagination add twig function
{{ pagination() }}
, (*9)
in future : - some better routing (cofigured by parameters) - using views togenerate pagination, (*10)
This Bundle is licensed under the MIT License. Feel free to contribute., (*11)
Simple array pagination in view
MIT
pagination array paginator array pagination