class ReplaceTitleCommand in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Ajax/ReplaceTitleCommand.php \Drupal\views\Ajax\ReplaceTitleCommand
Provides an AJAX command for replacing the page title.
This command is implemented in Drupal.AjaxCommands.prototype.viewsReplaceTitle.
Hierarchy
- class \Drupal\views\Ajax\ReplaceTitleCommand implements CommandInterface
Expanded class hierarchy of ReplaceTitleCommand
File
- core/
modules/ views/ src/ Ajax/ ReplaceTitleCommand.php, line 17 - Contains \Drupal\views\Ajax\ReplaceTitleCommand.
Namespace
Drupal\views\AjaxView source
class ReplaceTitleCommand implements CommandInterface {
/**
* The page title to replace.
*
* @var string
*/
protected $title;
/**
* Constructs a \Drupal\views\Ajax\ReplaceTitleCommand object.
*
* @param string $title
* The title of the page.
*/
public function __construct($title) {
$this->title = $title;
}
/**
* {@inheritdoc}
*/
public function render() {
return array(
'command' => 'viewsReplaceTitle',
'selector' => $this->title,
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ReplaceTitleCommand:: |
protected | property | The page title to replace. | |
ReplaceTitleCommand:: |
public | function |
Return an array to be run through json_encode and sent to the client. Overrides CommandInterface:: |
|
ReplaceTitleCommand:: |
public | function | Constructs a \Drupal\views\Ajax\ReplaceTitleCommand object. |