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

Breadcrumb

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

function OpenModalDialogWithUrl::render

Overrides CommandInterface::render

File

core/lib/Drupal/Core/Ajax/OpenModalDialogWithUrl.php, line 37

Class

OpenModalDialogWithUrl
Provides an AJAX command for opening a modal with URL.

Namespace

Drupal\Core\Ajax

Code

public function render() {
    // @see \Drupal\Core\Routing\LocalAwareRedirectResponseTrait::isLocal()
    if (!UrlHelper::isExternal($this->url) || UrlHelper::externalIsLocal($this->url, $this->getBaseURL())) {
        return [
            'command' => 'openModalDialogWithUrl',
            'url' => $this->url,
            'dialogOptions' => $this->settings,
        ];
    }
    throw new \LogicException('External URLs are not allowed.');
}

API Navigation

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