ns / filtered-pagination-bundle
This bundle provides a paginated filter handler
Installs: 11 795
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.1
- knplabs/knp-paginator-bundle: ^2.4||^5.0||^6.0
- lexik/form-filter-bundle: ^4.0||^5.0||^6.0||^7.0
- liip/rmt: ^1.6
- symfony/event-dispatcher: ^4.0||^5.0||^6.0
- symfony/form: ^4.0||^5.0||^6.0
- symfony/framework-bundle: ^4.0||^5.0||^6.0
- symfony/http-foundation: ^4.0||^5.0||^6.0
Requires (Dev)
- phpunit/phpunit: ^7.0||^9.5
This package is auto-updated.
Last update: 2025-01-17 06:07:20 UTC
README
composer require ns/filtered-pagination-bundle
Edit AppKernel.php and add the bundle
...
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
new NS\FilteredPaginationBundle\NSFilteredPaginationBundle(),
Usage
In a controller you request the filtered pagination bundle.
$query = $this->get('doctrine.orm.entity_manager')->getRepository('...')->getSomeQuery();
$filteredPaginator = $this->get('ns.filtered_pagination');
list($form, $pagination, $redirect) = $filteredPaginator->process($request, $formType, $query, 'sessionKey');
if ($redirect) {
return $this->redirect($this->generateUrl('practiceUsers'));
}
Limit Select
You can use the provided LimitSelectType to provide a 'X' results per page selector. If you do so you should include the main.js resource which handles detecting changes to the number per page.