You are here

protected function LayoutRebuildTrait::rebuildAndClose in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php \Drupal\layout_builder\Controller\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;
}