Pagination
When we have lots of data in our component, it will not be practical to show all the records on the same page, so we will need to implement pagination. Pagination allows us to split the content over multiple pages, and add navigation to easily locate the desired page of content. Firstly, we need to add pagination to our /administrator/com_folio/views/folios/view.html.php
. Just add the highlighted changes in the following code snippet:
<?php
defined('_JEXEC') or die;
class FolioViewFolios extends JViewLegacy
{
protected $items;
protected $state;
protected $pagination;
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->state = $this->get('State');
$this->pagination = $this->get('Pagination');
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render...