ActionController: provide central table helpers

This commit is contained in:
Thomas Gelf 2016-02-28 01:16:13 +01:00
parent e898b8e013
commit bc95c25d96
2 changed files with 13 additions and 13 deletions

View File

@ -179,17 +179,4 @@ class ListController extends ActionController
// $api->wipeInactiveStages();
}
}
protected function prepareTable($name)
{
$table = $this->loadTable($name)->setConnection($this->db());
$this->view->filterEditor = $table->getFilterEditor($this->getRequest());
$this->view->table = $this->applyPaginationLimits($table);
return $this;
}
protected function prepareAndRenderTable($name)
{
$this->prepareTable($name)->render('table');
}
}

View File

@ -147,6 +147,19 @@ abstract class ActionController extends Controller
return $this->view->tabs;
}
protected function prepareTable($name)
{
$table = $this->loadTable($name)->setConnection($this->db());
$this->view->filterEditor = $table->getFilterEditor($this->getRequest());
$this->view->table = $this->applyPaginationLimits($table);
return $this;
}
protected function prepareAndRenderTable($name)
{
$this->prepareTable($name)->render('list/table', null, true);
}
protected function api($endpointName = null)
{
if ($this->api === null) {