You are here

public function DynamicLayoutController::openEditRowModalForm in Dynamic Layouts 8

Callback for opening the modal form.

1 string reference to 'DynamicLayoutController::openEditRowModalForm'
dynamic_layouts.routing.yml in ./dynamic_layouts.routing.yml
dynamic_layouts.routing.yml

File

src/Controller/DynamicLayoutController.php, line 232

Class

DynamicLayoutController
DynamicLayoutController class.

Namespace

Drupal\dynamic_layouts\Controller

Code

public function openEditRowModalForm() {
  $response = new AjaxResponse();

  // Get the modal form using the form builder.
  $modal_form = $this->formBuilder
    ->getForm('Drupal\\dynamic_layouts\\Form\\EditRowModalForm');

  // Add an AJAX command to open a modal dialog with the form as the content.
  $response
    ->addCommand(new OpenModalDialogCommand('Edit row', $modal_form, [
    'width' => '800',
  ]));
  return $response;
}