Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Table.php

function Table::getCacheContexts

Overrides CacheableDependencyInterface::getCacheContexts

File

core/modules/views/src/Plugin/views/style/Table.php, line 436

Class

Table
Style plugin to render each item as a row in a table.

Namespace

Drupal\views\Plugin\views\style

Code

public function getCacheContexts() {
    $contexts = [];
    foreach ($this->options['info'] as $info) {
        if (!empty($info['sortable'])) {
            // The rendered link needs to play well with any other query parameter
            // used on the page, like pager and exposed filter.
            $contexts[] = 'url.query_args';
            break;
        }
    }
    return $contexts;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal