1. Go to this page and download the library: Download geniv/nette-visualpaginator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
geniv / nette-visualpaginator example snippets
use VisualPaginator;
...
/** @var VisualPaginator @inject */
public $visualPaginator;
public function renderDefault()
// for dibi
$items = $this->model->getList();
$items = range(1, 150);
$vp = $this->visualPaginator->getPaginator();
$vp->setItemCount(count($items))
->setItemsPerPage(5);
// for dibi
$this->template->items = $items->limit($vp->getLength())->offset($vp->getOffset());
// for array
$this->template->items = array_slice($items, $vp->getOffset(), $vp->getLength())
}
protected function createComponentVisualPaginator()
{
return $this->visualPaginator;
}
protected function createComponentVisualPaginator()
{
return $this->visualPaginator
->setPathTemplate(__DIR__ . '/templates/pagination.latte');
}
use AutowireComponentFactories;
use VisualPaginator;
protected function createComponentVisualPaginator(VisualPaginator $visualPaginator)
{
return $visualPaginator;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.