jrk / easypagination-bundle
easypagination bundle for symfony2/3
Installs: 200
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- ext-curl: *
- symfony/framework-bundle: >=2.0
This package is not auto-updated.
Last update: 2025-05-09 02:56:09 UTC
README
Setup
JRKEasyPaginationBundle requires the Pagerfanta api folder
- Using composer
Add jrk/easypagination-bundle as a dependency in your project's composer.json file:
{
"require": {
"jrk/easypagination-bundle": "dev-master"
}
}
Update composer
php composer update
or
php composer.phar update
- Add JRKEasyPaginationBundle to your application kernel
``` php
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new JRK\EasyPaginationBundle\JRKEasyPaginationBundle(),
);
}
Usage
- Using service
Open your controller and call the service.
<?php list($entities, $counter, $pager, $pagerHtml) = $this->get('jrk_easypagination')->paginate( $queryBuilder, // QueryBuilder array('args' => array('limit' => $limit), 'route' => self::$route_list), // Route for HTML widget $limit, // Number of items per page false, // OutOfRangeException quiet or not $page, // The page number (by default it will check for "page" attribute in the request) true // If you need the HTML widget ); ?>