Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme improvements #812

Merged
merged 6 commits into from
Oct 5, 2024
Merged
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ Generally this bundle is based on [Knp Pager component][knp_component_pager]. Th
component introduces a different way of pagination handling. You can read more about the
internal logic on the given documentation link.

[![knpbundles.com](http://knpbundles.com/KnpLabs/KnpPaginatorBundle/badge-short)](http://knpbundles.com/KnpLabs/KnpPaginatorBundle)

**Note:** Keep **knp-components** in sync with this bundle. If you want to use
older version of KnpPaginatorBundle - use **v3.0** or **v4.X** tags in the repository which is
suitable to paginate **ODM MongoDB** and **ORM 2.0** queries

## Latest updates

For notes about the latest changes please read [`CHANGELOG`](https://github.com/KnpLabs/KnpPaginatorBundle/blob/master/CHANGELOG.md),
for required changes in your code please read [`UPGRADE`](https://github.com/KnpLabs/KnpPaginatorBundle/blob/master/docs/upgrade.md)
chapter of the documentation.
For details regarding changes please read about the [releases](https://github.com/KnpLabs/KnpPaginatorBundle/releases).

## Requirements:

Expand All @@ -40,12 +36,11 @@ conflicting parameters.
## More detailed documentation:

- Creating [custom pagination subscribers][doc_custom_pagination_subscriber]
- [Extending pagination](#) class (todo, may require some refactoring)
- [Customizing view][doc_templates] templates and arguments

## Installation and configuration:

### Pretty simple with [Composer](http://packagist.org), run
### Pretty simple with [Composer](https://packagist.org), run

```sh
composer require knplabs/knp-paginator-bundle
Expand Down Expand Up @@ -86,7 +81,7 @@ knp_paginator:
filter_value_name: filterValue # filter value query parameter name
template:
pagination: '@KnpPaginator/Pagination/sliding.html.twig' # sliding pagination controls template
rel_links: '@KnpPaginator/Pagination/rel_links.html.twig' # <link rel=...> tags template
rel_links: '@KnpPaginator/Pagination/rel_links.html.twig' # <link rel=...> tags template
sortable: '@KnpPaginator/Pagination/sortable_link.html.twig' # sort link template
filtration: '@KnpPaginator/Pagination/filtration.html.twig' # filters template
```
Expand All @@ -112,7 +107,7 @@ return static function (ContainerConfigurator $configurator): void
],
'template' => [
'pagination' => '@KnpPaginator/Pagination/sliding.html.twig', // sliding pagination controls template
'rel_links' => '@KnpPaginator/Pagination/rel_links.html.twig', // <link rel=...> tags template
'rel_links' => '@KnpPaginator/Pagination/rel_links.html.twig', // <link rel=...> tags template
'sortable' => '@KnpPaginator/Pagination/sortable_link.html.twig', // sort link template
'filtration' => '@KnpPaginator/Pagination/filtration.html.twig' // filters template
]
Expand Down Expand Up @@ -189,8 +184,8 @@ public function listAction(EntityManagerInterface $em, PaginatorInterface $pagin

$pagination = $paginator->paginate(
$query, /* query NOT result */
$request->query->getInt('page', 1), /*page number*/
10 /*limit per page*/
$request->query->getInt('page', 1), /* page number */
10 /* limit per page */
);

// parameters to template
Expand Down