function ViewsTestDataViewsExecutionHooks::viewsPostRender

Implements hook_views_post_render().

File

core/modules/views/tests/modules/views_test_data/src/Hook/ViewsTestDataViewsExecutionHooks.php, line 81

Class

ViewsTestDataViewsExecutionHooks
Hook implementations for views_test_data.

Namespace

Drupal\views_test_data\Hook

Code

public function viewsPostRender(ViewExecutable $view, &$output, CachePluginBase $cache) {
    \Drupal::state()->set('views_hook_test_views_post_render', TRUE);
    if ($view->storage
        ->id() === 'test_page_display' && $view->current_display === 'empty_row') {
        for ($i = 0; $i < 5; $i++) {
            $output['#rows'][0]['#rows'][] = [];
        }
    }
}

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