You are here

public function FlysystemPluginBase::getExternalUrl in Flysystem 7

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://xIpLd0WQKCY" might be "http://www.youtube.com/watch?v=xIpLd0WQKCY".

Parameters

string $uri: The URI to provide a URL for.

Return value

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

Overrides FlysystemPluginInterface::getExternalUrl

1 call to FlysystemPluginBase::getExternalUrl()
Local::getExternalUrl in src/Flysystem/Local.php
Returns a web accessible URL for the resource.
2 methods override FlysystemPluginBase::getExternalUrl()
Local::getExternalUrl in src/Flysystem/Local.php
Returns a web accessible URL for the resource.
Missing::getExternalUrl in src/Flysystem/Missing.php
Returns a web accessible URL for the resource.

File

src/Plugin/FlysystemPluginBase.php, line 27
Contains FlysystemPluginBase.

Class

FlysystemPluginBase
Base class for plugins.

Namespace

Drupal\flysystem\Plugin

Code

public function getExternalUrl($uri) {
  $path = str_replace('\\', '/', $this
    ->getTarget($uri));
  return url('_flysystem/' . $this
    ->getScheme($uri) . '/' . $path, array(
    'absolute' => TRUE,
  ));
}