PHP code example of didweb / paginator
1. Go to this page and download the library: Download didweb/paginator 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/ */
didweb / paginator example snippets
use DidWeb\Paginator\Classes\Paginator;
$page = Tools::getValue('page');
$consult = $this->repositories->listReports2();
$urlBase = "index.php?controller=NAME_CONTROLLER"
."&token=".Tools::getValue('token');
$paginator_txt =array('Previous'=>'Previous', 'Next'=>'Next');
$paginator = Paginator::pagination($page, $consult, 20, $urlBase, 5, $paginator_txt);
$this->context->smarty->assign(array(
'list_items' => $paginator['result'],
'paginator' => $paginator
));
return $this->context->smarty->createTemplate(_PS_MODULE_DIR_.'name_of_your_module\views\templates\admin\/'. $tpl_name, $this->context->smarty);
use DidWeb\Paginator\Classes\Paginator;
$page = Tools::getValue('page');
$consult = $this->repositories->listReports2();
$urlBase = "index.php?controller=NAME_CONTROLLER"
."&token=".Tools::getValue('token');
$paginator_txt =array('Previous'=>'Bisherige', 'Next'=>'Nächster');
$paginator = Paginator::pagination($page, $consult, 20, $urlBase, 5, $paginator_txt);
$this->context->smarty->assign(array(
'list_items' => $paginator['result'],
'paginator' => $paginator
));
return $this->context->smarty->createTemplate(_PS_MODULE_DIR_.'name_of_your_module\views\templates\admin\/'. $tpl_name, $this->context->smarty);
use DidWeb\Paginator\Classes\Paginator;
$page = Tools::getValue('page');
$consult = $this->repositories->listReports2();
$urlBase = "index.php?controller=NAME_CONTROLLER"
."&token=".Tools::getValue('token');
$paginator_txt =array('Previous'=>'Anterior', 'Next'=>'Próximo');
$paginator = Paginator::pagination($page, $consult, 20, $urlBase, 5, $paginator_txt);
$this->context->smarty->assign(array(
'list_items' => $paginator['result'],
'paginator' => $paginator
));
return $this->context->smarty->createTemplate(_PS_MODULE_DIR_.'name_of_your_module\views\templates\admin\/'. $tpl_name, $this->context->smarty);