class ActionLinkFlashCommand in Flag 8.4
Flash a message as an action link is updated.
The client side code can be found in js/flag-action_link_flash.js.
Hierarchy
- class \Drupal\flag\Ajax\ActionLinkFlashCommand implements CommandInterface
Expanded class hierarchy of ActionLinkFlashCommand
2 files declare their use of ActionLinkFlashCommand
- ActionLinkController.php in src/
Controller/ ActionLinkController.php - ActionLinkFlashCommandTest.php in tests/
src/ Unit/ Ajax/ ActionLinkFlashCommandTest.php
File
- src/
Ajax/ ActionLinkFlashCommand.php, line 14
Namespace
Drupal\flag\AjaxView source
class ActionLinkFlashCommand implements CommandInterface {
/**
* Identifies the action link to be flashed.
*
* @var string
*/
protected $selector;
/**
* The message to be flashed under the link.
*
* @var string
*/
protected $message;
/**
* Construct a message Flasher.
*
* @param string $selector
* Identifies the action link to be flashed.
* @param string $message
* The message to be displayed.
*/
public function __construct($selector, $message) {
$this->selector = $selector;
$this->message = $message;
}
/**
* {@inheritdoc}
*/
public function render() {
return [
'command' => 'actionLinkFlash',
'selector' => $this->selector,
'message' => $this->message,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ActionLinkFlashCommand:: |
protected | property | The message to be flashed under the link. | |
ActionLinkFlashCommand:: |
protected | property | Identifies the action link to be flashed. | |
ActionLinkFlashCommand:: |
public | function |
Return an array to be run through json_encode and sent to the client. Overrides CommandInterface:: |
|
ActionLinkFlashCommand:: |
public | function | Construct a message Flasher. |