tablesort_init

tablesort_init($header) Initializes the table sort context. File core/includes/tablesort.inc, line 19 Functions to aid in the creation of sortable tables. Code function tablesort_init($header) { $ts = tablesort_get_order($header); $ts['sort'] = tablesort_get_sort($header); $ts['query'] = tablesort_get_query_parameters(); return $ts; }

TableSortExtender::orderByHeader

public TableSortExtender::orderByHeader(array $header) Order the query based on a header array. Parameters array $header: Table header array. Return value \Drupal\Core\Database\Query\SelectInterface The called object. See also table.html.twig File core/lib/Drupal/Core/Database/Query/TableSortExtender.php, line 37 Class TableSortExtender Query extender class for tablesort queries. Namespace Drupal\Core\Database\Query Code public function orderByHeader(array $header) { $this->hea

TableSortExtender::__construct

public TableSortExtender::__construct(SelectInterface $query, Connection $connection) Overrides SelectExtender::__construct File core/lib/Drupal/Core/Database/Query/TableSortExtender.php, line 17 Class TableSortExtender Query extender class for tablesort queries. Namespace Drupal\Core\Database\Query Code public function __construct(SelectInterface $query, Connection $connection) { parent::__construct($query, $connection); // Add convenience tag to mark that this is an extended que

tablesort_get_order

tablesort_get_order($headers) Determines the current sort criterion. Parameters $headers: An array of column headers in the format described in '#type' => 'table'. Return value An associative array describing the criterion, containing the keys: "name": The localized title of the table column. "sql": The name of the database field to sort on. File core/includes/tablesort.inc, line 97 Functions to aid in the creation of sortable tables. Code function tablesort_get_order($headers) { $

tablesort_header

tablesort_header(&$cell_content, array &$cell_attributes, array $header, array $ts) Formats a column header. If the cell in question is the column header for the current sort criterion, it gets special formatting. All possible sort criteria become links. Parameters string $cell_content: The cell content to format. Passed by reference. array $cell_attributes: The cell attributes. Passed by reference. array $header: An array of column headers in the format described in '#type' => 'tab

tablesort_get_sort

tablesort_get_sort($headers) Determines the current sort direction. Parameters $headers: An array of column headers in the format described in '#type' => 'table'. Return value The current sort direction ("asc" or "desc"). File core/includes/tablesort.inc, line 132 Functions to aid in the creation of sortable tables. Code function tablesort_get_sort($headers) { $query = \Drupal::request()->query; if ($query->has('sort')) { return (strtolower($query->get('sort')) == 'desc'

tablesort_get_query_parameters

tablesort_get_query_parameters() Composes a URL query parameter array for table sorting links. Return value A URL query parameter array that consists of all components of the current page request except for those pertaining to table sorting. File core/includes/tablesort.inc, line 82 Functions to aid in the creation of sortable tables. Code function tablesort_get_query_parameters() { return UrlHelper::filterQueryParameters(\Drupal::request()->query->all(), array('sort', 'order')); }

TableSortExtender::getQueryParameters

protected TableSortExtender::getQueryParameters() Compose a URL query parameter array to append to table sorting requests. Return value A URL query parameter array that consists of all components of the current page request except for those pertaining to table sorting. See also tablesort_get_query_parameters() File core/lib/Drupal/Core/Database/Query/TableSortExtender.php, line 82 Class TableSortExtender Query extender class for tablesort queries. Namespace Drupal\Core\Database\Query

TableSortExtender::init

protected TableSortExtender::init() Initialize the table sort context. File core/lib/Drupal/Core/Database/Query/TableSortExtender.php, line 54 Class TableSortExtender Query extender class for tablesort queries. Namespace Drupal\Core\Database\Query Code protected function init() { $ts = $this->order(); $ts['sort'] = $this->getSort(); $ts['query'] = $this->getQueryParameters(); return $ts; }

TableSortExtender::order

protected TableSortExtender::order() Determine the current sort criterion. Return value An associative array describing the criterion, containing the keys: "name": The localized title of the table column. "sql": The name of the database field to sort on. See also tablesort_get_order() File core/lib/Drupal/Core/Database/Query/TableSortExtender.php, line 96 Class TableSortExtender Query extender class for tablesort queries. Namespace Drupal\Core\Database\Query Code protected functi