function ViewsTestDataThemeHooks::preprocessViewsViewTable

Implements hook_preprocess_HOOK() for views table templates.

Attributes

#[Hook('preprocess_views_view_table')]

File

core/modules/views/tests/modules/views_test_data/src/Hook/ViewsTestDataThemeHooks.php, line 17

Class

ViewsTestDataThemeHooks
Hook implementations for views_test_data.

Namespace

Drupal\views_test_data\Hook

Code

public function preprocessViewsViewTable(&$variables) : void {
  if ($variables['view']->storage
    ->id() == 'test_view_render') {
    $views_render_test = \Drupal::state()->get('views_render.test');
    $views_render_test++;
    \Drupal::state()->set('views_render.test', $views_render_test);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.