<?php/**
* @file
* Contains \Drupal\Core\Ajax\RedirectCommand.
*/namespaceDrupal\Core\Ajax;
useDrupal\Core\Ajax\CommandInterface;
/**
* Defines an AJAX command to set the window.location, loading that URL.
*/class RedirectCommandimplements CommandInterface {
/**
* The URL that will be loaded into window.location.
*
* @var string
*/
protected $url;
/**
* Constructs an RedirectCommand object.
*
* @param string $url
* The URL that will be loaded into window.location. This should be a full
* URL, one that has already been run through the url() function.
*/
public function__construct($url) {
$this->url = $url;
}
/**
* Implements \Drupal\Core\Ajax\CommandInterface:render().
*/
public functionrender() {
returnarray(
'command' => 'redirect',
'url' => $this->url,
);
}
}