Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By dawehner on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Introduced in version:
8.0.0-beta12
Issue links:
Description:
Views got a new way to render itself. By using \Drupal\views\Plugin\views\display\DisplayPluginBase::buildBasicRenderable()
you get back a render array without the loaded view. This is as performant as you can get.
Before
$view = views_get_view('test_view');
$build = $view->preview('display_id', $args);
After
$build = DisplayPluginBase::buildBasicRenderable('test_view', 'display_id', $args);
Note: We might improve the way how we deal with it in the future.
Impacts:
Module developers
Themers