function SessionStreamWrapper::getExternalUrl
Same name in other branches
- 3.x modules/stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php \Drupal\stream_wrapper_example\StreamWrapper\SessionStreamWrapper::getExternalUrl()
- 4.0.x modules/stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php \Drupal\stream_wrapper_example\StreamWrapper\SessionStreamWrapper::getExternalUrl()
Overrides getExternalUrl().
We have set up a helper function and menu entry to provide access to this key via HTTP; normally it would be accessible some other way.
File
-
stream_wrapper_example/
src/ StreamWrapper/ SessionStreamWrapper.php, line 203
Class
- SessionStreamWrapper
- Example stream wrapper class to handle session:// streams.
Namespace
Drupal\stream_wrapper_example\StreamWrapperCode
public function getExternalUrl() {
$path = str_replace('\\', '/', $this->getLocalPath());
return Url::fromRoute('stream_wrapper_example.files.session', [
'filepath' => $path,
'scheme' => 'session',
], [
'absolute' => TRUE,
])->toString(FALSE);
}