function ViewsTestConfigHooks::viewsPostRender

Implements hook_views_post_render().

File

core/modules/views/tests/modules/views_test_config/src/Hook/ViewsTestConfigHooks.php, line 33

Class

ViewsTestConfigHooks
Hook implementations for views_test_config.

Namespace

Drupal\views_test_config\Hook

Code

public function viewsPostRender(ViewExecutable $view, &$output, CachePluginBase $cache) {
    if (\Drupal::state()->get('views_test_config.views_post_render_cache_tag')) {
        \Drupal::state()->set('views_test_config.views_post_render_called', TRUE);
        // Set a cache key on output to ensure ViewsSelection::stripAdminAndAnchorTagsFromResults
        // correctly handles elements that aren't result rows.
        $output['#cache']['tags'][] = 'foo';
    }
}

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