function tablesort_init
Same name in other branches
- 7.x 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
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());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.