pkshetlie / pagination-bundle
Easy way to make html table with paginations
v2.0.14
2024-01-22 21:06 UTC
Requires
- php: >=7.0
- doctrine/doctrine-bundle: >=1.6
- doctrine/orm: >=2.5
- dev-master
- v2.0.14
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.2.12
- v1.2.11
- v1.2.10
- 1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.09
- v1.0.08
- v1.0.07
- v1.0.06
- v1.0.05
- v1.0.04
- v1.0.03
- v1.0.02
- v1.0.01
This package is auto-updated.
Last update: 2024-09-22 22:39:32 UTC
README
composer require pkshetlie/pagination-bundle
add to AppKernel.php
[ ... new Pkshetlie\PaginationBundle\PaginationBundle(), ... ]
Add to config.yml
imports: ... - { resource: "@PaginationBundle/Resources/config/services.yml" }
installation is done.
Exemple Usage
in some Dummy controller
class DummyController extends Controller{ public function indexAction(Request $request){ $qb = $this->getDoctrine()->getReposiitory('DummyBundle:DummyEntity')->createQueryBuilder('x'); // you can add some /* $qb->orderBy( ... ) $qb->where( ... ) ... */ $pagination = $this->get('pkshetlie.pagination')->process($qb, $request); return $this->render('DummyBundle:Dummy:index.html.twig',[ 'pagination'=> $pagination, ]); } }
in the index.html.twig
{% import '@Pagination/Pagination/macro.twig' as macro_pagination %} <table> {% for entity in pagination.entities %} {# ... your stuff with <tr> / <td> #} {% endfor %} </table> {# draw the pagination #} {{ macro_pagination.paginate(pagination) }}
that's all !