rudra / rudra-paginaton-bundle
Paginator bundle for Symfony2 to automate pagination and simplify sorting and other features
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.3
- symfony/framework-bundle: ~2.7|~3.0
Requires (Dev)
- phpunit/phpunit: ~4.8
- symfony/expression-language: ~2.7|~3.0
This package is auto-updated.
Last update: 2024-11-12 20:50:40 UTC
README
RudraPaginatonBundle
Add PaginatorBundle to your application kernel
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Rudra\PaginationBundle\RudraPaginationBundle(),
// ...
);
}
Configuration example
You can configure default query parameter names and templates
rudra_pagination:
per_page: 1 # default page range used in pagination control
In Controller
$pagination = $this->get('rudra_pagination');
$pagination->init($id);
$pagination->setCount($this->getDoctrine()->getRepository(Blog::class)->numRows($conn));
$blogData = $this->getDoctrine()->getRepository(Blog::class)->getDataPerPage($conn, $pagination);
return $this->render('some/blog.html.twig', [
...
'links' => $pagination->getLinks(),
...
]
);