You are here

public function OpenBootstrap4ModalDialogCommand::render in Bootstrap 4 Modal 8

Same name and namespace in other branches
  1. 2.x src/Ajax/OpenBootstrap4ModalDialogCommand.php \Drupal\bootstrap4_modal\Ajax\OpenBootstrap4ModalDialogCommand::render()

Implements \Drupal\Core\Ajax\CommandInterface:render().

Overrides OpenDialogCommand::render

File

src/Ajax/OpenBootstrap4ModalDialogCommand.php, line 43

Class

OpenBootstrap4ModalDialogCommand
Defines an AJAX command to open certain content in a dialog in a modal.

Namespace

Drupal\bootstrap4_modal\Ajax

Code

public function render() {

  // For consistency ensure the modal option is set to TRUE or FALSE.
  $this->dialogOptions['modal'] = isset($this->dialogOptions['modal']) && $this->dialogOptions['modal'];
  return [
    'command' => 'openBootstrap4Dialog',
    'selector' => $this->selector,
    'settings' => $this->settings,
    'data' => $this
      ->getRenderedContent(),
    'dialogOptions' => $this->dialogOptions,
  ];
}