function LayoutBuilder::addRenderedLayoutBuilder

Same name and namespace in other branches
  1. 11.x core/modules/layout_builder/src/Element/LayoutBuilder.php \Drupal\layout_builder\Element\LayoutBuilder::addRenderedLayoutBuilder()

Render API #post_render callback that adds layout builder markup to form.

Attributes

#[TrustedCallback]

Parameters

string $html: The rendered form.

array $form: The form render array.

Return value

string The render string with any layout builder markup added.

File

core/modules/layout_builder/src/Element/LayoutBuilder.php, line 144

Class

LayoutBuilder
Defines a render element for building the Layout Builder UI.

Namespace

Drupal\layout_builder\Element

Code

public static function addRenderedLayoutBuilder(string $html, array $form) : string {
  if (isset($form['#layout_builder_markup'])) {
    $html .= $form['#layout_builder_markup'];
  }
  return $html;
}

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