class CloseBootstrap4ModalDialogCommand in Bootstrap 4 Modal 8
Same name and namespace in other branches
- 2.x src/Ajax/CloseBootstrap4ModalDialogCommand.php \Drupal\bootstrap4_modal\Ajax\CloseBootstrap4ModalDialogCommand
Defines an AJAX command that closes the currently visible modal dialog.
Hierarchy
- class \Drupal\Core\Ajax\CloseDialogCommand implements CommandInterface
- class \Drupal\Core\Ajax\CloseModalDialogCommand
- class \Drupal\bootstrap4_modal\Ajax\CloseBootstrap4ModalDialogCommand
- class \Drupal\Core\Ajax\CloseModalDialogCommand
Expanded class hierarchy of CloseBootstrap4ModalDialogCommand
File
- src/
Ajax/ CloseBootstrap4ModalDialogCommand.php, line 12
Namespace
Drupal\bootstrap4_modal\AjaxView source
class CloseBootstrap4ModalDialogCommand extends CloseModalDialogCommand {
/**
* Constructs a CloseModalDialogCommand object.
*
* @param bool $persist
* (optional) Whether to persist the dialog in the DOM or not.
*/
public function __construct($persist = FALSE) {
parent::__construct($persist);
$this->selector = '#drupal-bootstrap4-modal';
}
/**
* {@inheritdoc}
*/
public function render() {
return [
'command' => 'closeBootstrap4Dialog',
'selector' => $this->selector,
'persist' => $this->persist,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CloseBootstrap4ModalDialogCommand:: |
public | function |
Return an array to be run through json_encode and sent to the client. Overrides CloseDialogCommand:: |
|
CloseBootstrap4ModalDialogCommand:: |
public | function |
Constructs a CloseModalDialogCommand object. Overrides CloseModalDialogCommand:: |
|
CloseDialogCommand:: |
protected | property | Whether to persist the dialog in the DOM or not. | |
CloseDialogCommand:: |
protected | property | A CSS selector string of the dialog to close. |