function tablesort_init in Drupal 8
Same name and namespace in other branches
- 4 includes/tablesort.inc \tablesort_init()
- 5 includes/tablesort.inc \tablesort_init()
- 6 includes/tablesort.inc \tablesort_init()
- 7 includes/tablesort.inc \tablesort_init()
Initializes the table sort context.
Deprecated
in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Utility\TableSort::getContextFromRequest() instead.
See also
\Drupal\Core\Utility\TableSortInterface::getContextFromRequest()
https://www.drupal.org/node/3009182
1 call to tablesort_init()
- TableSortLegacyTest::testInit in core/
tests/ Drupal/ KernelTests/ Core/ Theme/ TableSortLegacyTest.php - Tests deprecation of the tablesort_init() function.
File
- core/
includes/ tablesort.inc, line 23 - Functions to aid in the creation of sortable tables.
Code
function tablesort_init($header) {
@trigger_error(__FUNCTION__ . '() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \\Drupal\\Core\\Utility\\TableSort::getContextFromRequest() instead. See https://www.drupal.org/node/3009182', E_USER_DEPRECATED);
return TableSort::getContextFromRequest($header, \Drupal::request());
}