An open API service indexing awesome lists of open source software.

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

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


```