Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LayoutRebuildTrait.php

function LayoutRebuildTrait::rebuildAndClose

Rebuilds the layout.

Parameters

\Drupal\layout_builder\SectionStorageInterface $section_storage: The section storage.

Return value

\Drupal\Core\Ajax\AjaxResponse An AJAX response to either rebuild the layout and close the dialog, or reload the page.

5 calls to LayoutRebuildTrait::rebuildAndClose()
AddSectionController::build in core/modules/layout_builder/src/Controller/AddSectionController.php
Adds the new section.
ConfigureBlockFormBase::successfulAjaxSubmit in core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php
Allows the form to respond to a successful AJAX submission.
ConfigureSectionForm::successfulAjaxSubmit in core/modules/layout_builder/src/Form/ConfigureSectionForm.php
Allows the form to respond to a successful AJAX submission.
LayoutRebuildConfirmFormBase::successfulAjaxSubmit in core/modules/layout_builder/src/Form/LayoutRebuildConfirmFormBase.php
Allows the form to respond to a successful AJAX submission.
MoveBlockForm::successfulAjaxSubmit in core/modules/layout_builder/src/Form/MoveBlockForm.php
Allows the form to respond to a successful AJAX submission.

File

core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php, line 25

Class

LayoutRebuildTrait
Provides AJAX responses to rebuild the Layout Builder.

Namespace

Drupal\layout_builder\Controller

Code

protected function rebuildAndClose(SectionStorageInterface $section_storage) {
    $response = $this->rebuildLayout($section_storage);
    $response->addCommand(new CloseDialogCommand('#drupal-off-canvas'));
    return $response;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal