trait RenderTrait in UI Patterns 8
Helper rendering trait.
Hierarchy
- trait \Drupal\Tests\ui_patterns\Traits\RenderTrait
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\TraitsView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RenderTrait:: |
protected | function | Renders final HTML given a structured array tree. |