You are here

public function ViewExecutable::getUrlInfo in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::getUrlInfo()

Gets the Url object associated with the display handler.

Parameters

string $display_id: (Optional) The display id. ( Used only to detail an exception. )

Return value

\Drupal\Core\Url The display handlers URL object.

Throws

\InvalidArgumentException Thrown when the display plugin does not have a URL to return.

File

core/modules/views/src/ViewExecutable.php, line 1874
Contains \Drupal\views\ViewExecutable.

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public function getUrlInfo($display_id = '') {
  $this
    ->initDisplay();
  if (!$this->display_handler instanceof DisplayRouterInterface) {
    throw new \InvalidArgumentException("You cannot generate a URL for the display '{$display_id}'");
  }
  return $this->display_handler
    ->getUrlInfo();
}