https://github.com/uniplaces/paginationbundle
A working pagination bundle for Symfony 2
https://github.com/uniplaces/paginationbundle
Last synced: 3 months ago
JSON representation
A working pagination bundle for Symfony 2
- Host: GitHub
- URL: https://github.com/uniplaces/paginationbundle
- Owner: uniplaces
- License: mit
- Created: 2012-06-29T10:25:26.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-07-03T09:28:59.000Z (almost 13 years ago)
- Last Synced: 2025-03-25T07:35:15.483Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 108 KB
- Stars: 4
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
Uniplaces Pagination Bundle for Symfony2
========================================### Instalation:
Add the submodule:
```
git submodule add git://github.com/uniplaces/PaginationBundle.git vendor/bundles/Uniplaces/PaginationBundle
```Register the namespace in app/autoload.php:
```
'Uniplaces' => __DIR__.'/../vendor/bundles',
```And finally add load the budle in the bundles list in app/AppKernel.php:
```
new Uniplaces\PaginationBundle\UniplacesPaginationBundle()
```### Basic usage:
In your controller:
```php
use Uniplaces\PaginationBundle\Paginator\Paginator;
use YourApp\YourBundle\Paginator\PageableObject;
``````php
$paginator = new Paginator(new PageableObject($queryObject), $currentPage);
``````php
return $this->render('UniplacesPaginationBundle:Default:test.html.twig', array('paginator' => $paginator));
```In the view:
```
{{ paginate_widget(paginator, routeRoute, routeParameters) }}
```The result:
```html
```