function LayoutBuilderTestHooks::formLayoutBuilderConfigureSectionAlter

Implements hook_form_BASE_FORM_ID_alter() for layout_builder_configure_section.

File

core/modules/layout_builder/tests/modules/layout_builder_test/src/Hook/LayoutBuilderTestHooks.php, line 87

Class

LayoutBuilderTestHooks
Hook implementations for layout_builder_test.

Namespace

Drupal\layout_builder_test\Hook

Code

public function formLayoutBuilderConfigureSectionAlter(&$form, FormStateInterface $form_state, $form_id) : void {
    
    /** @var \Drupal\layout_builder\Form\ConfigureSectionForm $form_object */
    $form_object = $form_state->getFormObject();
    $form['layout_builder_test']['storage'] = [
        '#type' => 'item',
        '#title' => 'Layout Builder Storage: ' . $form_object->getSectionStorage()
            ->getStorageId(),
    ];
    $form['layout_builder_test']['section'] = [
        '#type' => 'item',
        '#title' => 'Layout Builder Section: ' . $form_object->getCurrentSection()
            ->getLayoutId(),
    ];
    $form['layout_builder_test']['layout'] = [
        '#type' => 'item',
        '#title' => 'Layout Builder Layout: ' . $form_object->getCurrentLayout()
            ->getPluginId(),
    ];
}

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