Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / views / src / Ajax / ReplaceTitleCommand.php
1 <?php
2
3 namespace Drupal\views\Ajax;
4
5 use Drupal\Core\Ajax\CommandInterface;
6
7 /**
8  * Provides an AJAX command for replacing the page title.
9  *
10  * This command is implemented in Drupal.AjaxCommands.prototype.viewsReplaceTitle.
11  */
12 class ReplaceTitleCommand implements CommandInterface {
13
14   /**
15    * The page title to replace.
16    *
17    * @var string
18    */
19   protected $title;
20
21   /**
22    * Constructs a \Drupal\views\Ajax\ReplaceTitleCommand object.
23    *
24    * @param string $title
25    *   The title of the page.
26    */
27   public function __construct($title) {
28     $this->title = $title;
29   }
30
31   /**
32    * {@inheritdoc}
33    */
34   public function render() {
35     return [
36       'command' => 'viewsReplaceTitle',
37       'selector' => $this->title,
38     ];
39   }
40
41 }