Drupal 8.0.0 beta 12. More info: https://www.drupal.org/node/2514176
This commit is contained in:
commit
9921556621
13277 changed files with 1459781 additions and 0 deletions
46
core/modules/views/src/Ajax/ReplaceTitleCommand.php
Normal file
46
core/modules/views/src/Ajax/ReplaceTitleCommand.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\views\Ajax\ReplaceTitleCommand.
|
||||
*/
|
||||
|
||||
namespace Drupal\views\Ajax;
|
||||
|
||||
use Drupal\Core\Ajax\CommandInterface;
|
||||
|
||||
/**
|
||||
* Provides an AJAX command for replacing the page title.
|
||||
*
|
||||
* This command is implemented in Drupal.AjaxCommands.prototype.viewsReplaceTitle.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Core\Ajax\CommandInterface::render().
|
||||
*/
|
||||
public function render() {
|
||||
return array(
|
||||
'command' => 'viewsReplaceTitle',
|
||||
'selector' => $this->title,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue