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