public function BlockDeleteForm::submitFormAjax in Context 8.4
Same name and namespace in other branches
- 8 src/Reaction/Blocks/Form/BlockDeleteForm.php \Drupal\context\Reaction\Blocks\Form\BlockDeleteForm::submitFormAjax()
- 8.0 src/Reaction/Blocks/Form/BlockDeleteForm.php \Drupal\context\Reaction\Blocks\Form\BlockDeleteForm::submitFormAjax()
Handle when the form is submitted trough AJAX.
Return value
\Drupal\Core\Ajax\AjaxResponse The ajax response.
File
- src/
Reaction/ Blocks/ Form/ BlockDeleteForm.php, line 144
Class
- BlockDeleteForm
- Provides a form to delete a block from block reaction.
Namespace
Drupal\context\Reaction\Blocks\FormCode
public function submitFormAjax() {
$contextForm = $this->contextManager
->getForm($this->context, 'edit');
$response = new AjaxResponse();
$response
->addCommand(new CloseModalDialogCommand());
$response
->addCommand(new ReplaceCommand('#context-reactions', $contextForm['reactions']));
return $response;
}