You are here

trait RenderTrait in UI Patterns 8

Helper rendering trait.

Hierarchy

1 file declares its use of RenderTrait
UiPatternsPreviewTest.php in tests/src/Kernel/UiPatternsPreviewTest.php

File

tests/src/Traits/RenderTrait.php, line 8

Namespace

Drupal\Tests\ui_patterns\Traits
View source
trait RenderTrait {

  /**
   * Renders final HTML given a structured array tree.
   *
   * @param array $elements
   *   The structured array describing the data to be rendered.
   *
   * @return string
   *   The rendered HTML.
   *
   * @throws \Exception
   *   When called from inside another renderRoot() call.
   *
   * @see \Drupal\Core\Render\RendererInterface::render()
   */
  protected function renderRoot(array &$elements) {
    return (string) $this->container
      ->get('renderer')
      ->renderRoot($elements);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RenderTrait::renderRoot protected function Renders final HTML given a structured array tree.