Registry / web-framework / knplabs-knp-paginator-bundle

knplabs-knp-paginator-bundle

JSON →
library6.10.0phppackagistunverified

Paginator bundle for Symfony to automate pagination and simplify sorting and other features

composer require knplabs/knp-paginator-bundle
INSTALL
IMPORT
SIG · KNPLABS-KNP-PAGINA
K
knplabs-knp-paginator-bundle
web-frameworkphpv6.10.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PaginatorInterface
use Knp\Component\Pager\PaginatorInterface;

Paginate a query result in a Symfony controller.

<?php namespace App\Controller; use Knp\Component\Pager\PaginatorInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; class PostController extends AbstractController { public function index(Request $request, PaginatorInterface $paginator) { $pagination = $paginator->paginate( $this->getDoctrine()->getRepository(Post::class)->findAll(), $request->query->getInt('page', 1), 10 ); return $this->render('post/index.html.twig', ['pagination' => $pagination]); } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
6.10.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
knplabs-knp-paginator-bundle — pip install knplabs-knp-paginator-bundle · libregistry