ModalWindowEvent
in package
Immutable data of a modal window needed to render it.
The target is the unique key of the modal in the registry.
Table of Contents
Properties
- $content : string
- $htmlId : string
- $options : array<string|int, mixed>
- $target : string
- $title : string
Methods
- __construct() : mixed
- getContent() : string
- getHtmlId() : string
- getOption() : mixed
- getOptions() : array<string, mixed>
- getStyle() : string
- Returns the display style of the modal (`default`, `modern`, `minimal`, ...).
- getTarget() : string
- getTitle() : string
- hasOption() : bool
- isAutoTarget() : bool
- Returns whether the target was generated automatically.
- withContent() : self
- withOptions() : self
- withTitle() : self
- generateAutoTarget() : string
- Generates a unique automatic target.
Properties
$content
private
string
$content
= ''
$htmlId
private
string
$htmlId
$options
private
array<string|int, mixed>
$options
= []
$target
private
string
$target
$title
private
string
$title
Methods
__construct()
public
__construct([string|null $target = null ][, string|Stringable $title = '' ][, string $content = '' ][, array<string, mixed> $options = [] ]) : mixed
Parameters
- $target : string|null = null
-
unique modal key (null generates one)
- $title : string|Stringable = ''
-
modal title (plain string or translator output)
- $content : string = ''
-
HTML content of the modal
- $options : array<string, mixed> = []
-
settings (size, backdrop, keyboard, style, ...)
getContent()
public
getContent() : string
Return values
stringgetHtmlId()
public
getHtmlId() : string
Return values
stringgetOption()
public
getOption(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
getOptions()
public
getOptions() : array<string, mixed>
Return values
array<string, mixed>getStyle()
Returns the display style of the modal (`default`, `modern`, `minimal`, ...).
public
getStyle() : string
Return values
stringgetTarget()
public
getTarget() : string
Return values
stringgetTitle()
public
getTitle() : string
Return values
stringhasOption()
public
hasOption(string $key) : bool
Parameters
- $key : string
Return values
boolisAutoTarget()
Returns whether the target was generated automatically.
public
isAutoTarget() : bool
Return values
boolwithContent()
public
withContent(string $content) : self
Parameters
- $content : string
Return values
selfwithOptions()
public
withOptions(array<string, mixed> $options) : self
Parameters
- $options : array<string, mixed>
Return values
selfwithTitle()
public
withTitle(string $title) : self
Parameters
- $title : string
Return values
selfgenerateAutoTarget()
Generates a unique automatic target.
private
generateAutoTarget() : string