function layout_builder_test_form_layout_builder_configure_section_alter

Same name in other branches
  1. 10 core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module \layout_builder_test_form_layout_builder_configure_section_alter()
  2. 11.x core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module \layout_builder_test_form_layout_builder_configure_section_alter()

Implements hook_form_BASE_FORM_ID_alter() for layout_builder_configure_section.

File

core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module, line 103

Code

function layout_builder_test_form_layout_builder_configure_section_alter(&$form, FormStateInterface $form_state, $form_id) {
    
    /** @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.