function LayoutRebuildTrait::rebuildAndClose

Same name in other branches
  1. 8.9.x core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php \Drupal\layout_builder\Controller\LayoutRebuildTrait::rebuildAndClose()
  2. 10 core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php \Drupal\layout_builder\Controller\LayoutRebuildTrait::rebuildAndClose()
  3. 11.x 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;
}

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