function DummyExternalReadOnlyWrapper::getExternalUrl

Same name and namespace in other branches
  1. 9 core/modules/file/tests/file_test/src/StreamWrapper/DummyExternalReadOnlyWrapper.php \Drupal\file_test\StreamWrapper\DummyExternalReadOnlyWrapper::getExternalUrl()
  2. 11.x core/modules/file/tests/file_test/src/StreamWrapper/DummyExternalReadOnlyWrapper.php \Drupal\file_test\StreamWrapper\DummyExternalReadOnlyWrapper::getExternalUrl()

Returns a web accessible URL for the resource.

This function should return a URL that can be embedded in a web page and accessed from a browser. For example, the external URL of "youtube://random_string" might be "http://www.youtube.com/watch?v=random_string".

Return value

string Returns a string containing a web accessible URL for the resource.

Overrides StreamWrapperInterface::getExternalUrl

File

core/modules/file/tests/file_test/src/StreamWrapper/DummyExternalReadOnlyWrapper.php, line 39

Class

DummyExternalReadOnlyWrapper
Helper class for testing the stream wrapper registry.

Namespace

Drupal\file_test\StreamWrapper

Code

public function getExternalUrl() {
    [
        ,
        $target,
    ] = explode('://', $this->uri, 2);
    return 'https://www.dummy-external-readonly.com/' . $target;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.