class OpenCommand in Colorbox Load 8
Defines an AJAX command to open content in a colorbox.
Hierarchy
- class \Drupal\colorbox_load\OpenCommand implements CommandInterface
Expanded class hierarchy of OpenCommand
File
- src/
OpenCommand.php, line 10
Namespace
Drupal\colorbox_loadView source
class OpenCommand implements CommandInterface {
/**
* The content for the colorbox.
*
* @var string
*/
protected $content;
/**
* Constructs an OpenCommand object.
*
* @param string $content
* The content that will be placed in the colorbox.
*/
public function __construct($content) {
$this->content = $content;
}
/**
* Render.
*
* {@inheritdoc}.
*/
public function render() {
return [
'command' => 'colorboxLoadOpen',
'data' => $this->content,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OpenCommand:: |
protected | property | The content for the colorbox. | |
OpenCommand:: |
public | function |
Render. Overrides CommandInterface:: |
|
OpenCommand:: |
public | function | Constructs an OpenCommand object. |