class CloseModalDialogCommand
Defines an AJAX command that closes the currently visible modal dialog.
Hierarchy
- class \Drupal\Core\Ajax\CloseDialogCommand implements \Drupal\Core\Ajax\CommandInterface
- class \Drupal\Core\Ajax\CloseModalDialogCommand extends \Drupal\Core\Ajax\CloseDialogCommand
Expanded class hierarchy of CloseModalDialogCommand
Related topics
- Ajax API
- Overview for Drupal's Ajax API.
1 file declares its use of CloseModalDialogCommand
- ViewsFormBase.php in core/
modules/ views_ui/ src/ Form/ Ajax/ ViewsFormBase.php
File
-
core/
lib/ Drupal/ Core/ Ajax/ CloseModalDialogCommand.php, line 10
Namespace
Drupal\Core\AjaxView source
class CloseModalDialogCommand extends CloseDialogCommand {
/**
* Constructs a CloseModalDialogCommand object.
*
* @param bool $persist
* (optional) Whether to persist the dialog in the DOM or not.
*/
public function __construct($persist = FALSE) {
$this->selector = '#drupal-modal';
$this->persist = $persist;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
CloseDialogCommand::$persist | protected | property | Whether to persist the dialog in the DOM or not. | |
CloseDialogCommand::$selector | protected | property | A CSS selector string of the dialog to close. | |
CloseDialogCommand::render | public | function | Return an array to be run through json_encode and sent to the client. | Overrides CommandInterface::render |
CloseModalDialogCommand::__construct | public | function | Constructs a CloseModalDialogCommand object. | Overrides CloseDialogCommand::__construct |