OpenModalDialogCommand
class OpenModalDialogCommand extends OpenDialogCommand (View source)
Defines an AJAX command to open certain content in a dialog in a modal dialog.
Traits
Trait for Ajax commands that render content and attach assets.
Properties
| protected AttachedAssets | $attachedAssets | The attached assets for this Ajax command. |
from CommandWithAttachedAssetsTrait |
| protected string | $selector | The selector of the dialog. |
from OpenDialogCommand |
| protected string | $title | The title of the dialog. |
from OpenDialogCommand |
| protected string|array | $content | The content for the dialog. |
from OpenDialogCommand |
| protected array | $dialogOptions | Stores dialog-specific options passed directly to jQuery UI dialogs. Any jQuery UI option can be used. See http://api.jqueryui.com/dialog. |
from OpenDialogCommand |
| protected array | $settings | Custom settings that will be passed to the Drupal behaviors on the content of the dialog. |
from OpenDialogCommand |
Methods
Processes the content for output.
Gets the attached assets.
Constructs an OpenModalDialog object.
Sets a single dialog option value.
Sets the dialog title (an alias of setDialogOptions).
Details
protected string|MarkupInterface
getRenderedContent()
Processes the content for output.
If content is a render array, it may contain attached assets to be processed.
AttachedAssets|null
getAttachedAssets()
Gets the attached assets.
__construct(string $title, string|array $content, array $dialog_options = [], array|null $settings = NULL)
Constructs an OpenModalDialog object.
The modal dialog differs from the normal modal provided by OpenDialogCommand in that a modal prevents other interactions on the page until the modal has been completed. Drupal provides a built-in modal for this purpose, so no selector needs to be provided.
array
getDialogOptions()
Returns the dialog options.
setDialogOptions(array $dialog_options)
Sets the dialog options array.
setDialogOption(string $key, mixed $value)
Sets a single dialog option value.
setDialogTitle(string $title)
Sets the dialog title (an alias of setDialogOptions).
render()
Implements \Drupal\Core\Ajax\CommandInterface:render().