protected function AreaDisplayLinkTest::renderDisplayLink in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php \Drupal\Tests\views\Kernel\Handler\AreaDisplayLinkTest::renderDisplayLink()
- 9 core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php \Drupal\Tests\views\Kernel\Handler\AreaDisplayLinkTest::renderDisplayLink()
Render a display link.
Parameters
\Drupal\views\ViewExecutable $view: The view to render the link for.
string $display_link_id: The display link ID to render.
Return value
string The rendered display link.
File
- core/
modules/ views/ tests/ src/ Kernel/ Handler/ AreaDisplayLinkTest.php, line 363
Class
- AreaDisplayLinkTest
- Tests the core views_handler_area_display_link handler.
Namespace
Drupal\Tests\views\Kernel\HandlerCode
protected function renderDisplayLink(ViewExecutable $view, $display_link_id) {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container
->get('renderer');
$display_link = $view->display_handler
->getHandler('header', $display_link_id)
->render();
return $renderer
->renderRoot($display_link)
->__toString();
}