aleswita / visualpaginator
VisualPaginator for Nette Framework.
Installs: 13 036
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 3
Open Issues: 0
Requires
- php: ^7.4|^8.0
- latte/latte: ^2.9
- nette/application: ^3.1
- nette/forms: ^3.0
- nette/http: ^3.1
- nette/utils: ^3.2
Requires (Dev)
- nette/bootstrap: ^3.1
- nette/di: ^3.0
- nette/robot-loader: ^3.3
- nette/routing: ^3.0
- nette/tester: ^2.3
- ninjify/nunjuck: ^0.3
- ninjify/qa: ^0.12
- phpstan/phpstan: ^0.12
- phpstan/phpstan-deprecation-rules: ^0.12
- phpstan/phpstan-nette: ^0.12
- phpstan/phpstan-strict-rules: ^0.12
- tracy/tracy: ^2.8
README
Visual Paginator for Nette Framework.
Installation
The best way to install AlesWita/VisualPaginator is using Composer:
$ composer require aleswita/visualpaginator
Usage
Neon
services: - AlesWita\VisualPaginator\VisualPaginatorFactory
Presenter
<?php declare(strict_types = 1); use AlesWita\VisualPaginator\VisualPaginator; use AlesWita\VisualPaginator\VisualPaginatorFactory; use Nette\Application\UI\Presenter; final class HomePresenter extends Presenter { /** @inject */ public VisualPaginatorFactory $visualPaginatorFactory; public function actionDefault(): void { $this['paginator']->setItemCount(1000); $offset = $this['paginator']->getOffset(); $itemsPerPage = $this['paginator']->getItemsPerPage(); ['SELECT * FROM `orders` LIMIT ? OFFSET ?', $itemsPerPage, $offset]; } protected function createComponentPaginator(): VisualPaginator { $paginator = $this->visualPaginatorFactory->create(); $paginator->ajax = true; $paginator->canSetItemsPerPage = true; $paginator->templateFile = __DIR__ . '/my_awesome_template.latte'; return $paginator; } }
Template
{control paginator}
Custom paginator template
{templateType AlesWita\VisualPaginator\Template} ...