function LayoutBuilderTestThemeHooks::layoutOneCol

Implements hook_preprocess_HOOK() for one-column layout template.

Attributes

#[Hook('preprocess_layout__onecol')]

File

core/modules/layout_builder/tests/modules/layout_builder_test/src/Hook/LayoutBuilderTestThemeHooks.php, line 34

Class

LayoutBuilderTestThemeHooks
Theme hook implementations for layout_builder_test.

Namespace

Drupal\layout_builder_test\Hook

Code

public function layoutOneCol(&$vars) : void {
  if (!empty($vars['content']['#entity'])) {
    $vars['content']['content'][$this->uuid
      ->generate()] = [
      '#type' => 'markup',
      '#markup' => sprintf('Yes, I can access the %s', $vars['content']['#entity']->label()),
    ];
  }
}

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