Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ViewExecutable.php

function 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 2058

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();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal