In a Joomla! 3 component, there is usually some view filters that allow you to limit the items shown, for instance, only showing items where the status
is published
. Besides the status
filter, we usually expect to see search in title, sort table by, and ordering.
We will start off by adding the sidebar with a status
filter. Edit the file /administrator/components/com_folio/views/folios/view.html.php
.
<?php
defined('_JEXEC') or die;
class FolioViewFolios extends JViewLegacy
{
protected $items;
protected $state;
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->state = $this->get('State');
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
parent::display($tpl);
}
protected function addToolbar()
{
$canDo = FolioHelper...