ardiakov / simple-pagination
There is no license information available for the latest version (1.1) of this package.
Simple pagination class
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
1.1
2021-06-22 13:15 UTC
Requires
- php: ^7.4 || ^8.0
- doctrine/dbal: ^2.10
- doctrine/orm: ^2.8
Requires (Dev)
- phpunit/phpunit: ^8.4
This package is not auto-updated.
Last update: 2026-06-03 12:32:58 UTC
README
Пример использования пагинации на примере doctrine/orm
$perPage = 20; $currentPage = (int) $request->query->get('page', 1); $qb = $this->repository->paginationQuery(); $pagination = new Paginator($perPage, $currentPage, new DoctrineOrmDataProvider($qb)); return [ 'list' => $pagination->result(), 'currentPage' => $currentPage, 'pages' => $pagination->pages(), 'totalResult' => $pagination->countResult(), ];
Подключение twig шаблона
# app/config/config.yml twig: # ... paths: '%kernel.project_dir%/vendor/ardiakov/simple-pagination/src/resources/templates': simple-pagination
Вывести шаблон в нужном месте
{% include '@simple-pagination/_pagination.html.twig' with {
'routeName': 'worki_vacancy_list',
'routeParameters': {}
} %}