function test_subtheme_views_post_render

Same name and namespace in other branches
  1. 10 core/modules/system/tests/themes/test_subtheme/test_subtheme.theme \test_subtheme_views_post_render()
  2. 9 core/modules/system/tests/themes/test_subtheme/test_subtheme.theme \test_subtheme_views_post_render()
  3. 8.9.x core/modules/system/tests/themes/test_subtheme/test_subtheme.theme \test_subtheme_views_post_render()
  4. main core/modules/system/tests/themes/test_subtheme/test_subtheme.theme \test_subtheme_views_post_render()

Implements hook_views_post_render().

2 string references to 'test_subtheme_views_post_render'
TestSubthemeHooks::viewsPostRender in core/modules/system/tests/themes/test_subtheme/src/Hook/TestSubthemeHooks.php
Implements hook_views_post_render().
ViewsThemeIntegrationTest::testThemedViewPage in core/modules/views/tests/src/Functional/ViewsThemeIntegrationTest.php
Tests pre_render and post_render hooks in a theme and sub-theme.

File

core/modules/system/tests/themes/test_subtheme/test_subtheme.theme, line 24

Code

function test_subtheme_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) : void {
  // We append the function name to the title for test to check for.
  $view->setTitle($view->getTitle() . ":" . __FUNCTION__);
  if ($view->id() == 'test_page_display') {
    $output['#rows'][0]['#title'] = t('%total_rows items found.', [
      '%total_rows' => $view->total_rows,
    ]);
  }
}

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