public function TrumbaBlockBase::convertUriToRelativePathOrUrl in Trumba 8
Same name and namespace in other branches
- 2.x src/Plugin/Block/TrumbaBlockBase.php \Drupal\trumba\Plugin\Block\TrumbaBlockBase::convertUriToRelativePathOrUrl()
Convert a saved Uri String to an relative path for internal uri's or a full Url for external urls
Parameters
$uri:
Return value
\Drupal\Core\GeneratedUrl|string
1 call to TrumbaBlockBase::convertUriToRelativePathOrUrl()
- TrumbaBlockBase::blockForm in src/
Plugin/ Block/ TrumbaBlockBase.php
File
- src/
Plugin/ Block/ TrumbaBlockBase.php, line 151
Class
- TrumbaBlockBase
- Defines a base block implementation that Trumba blocks plugins will extend.
Namespace
Drupal\trumba\Plugin\BlockCode
public function convertUriToRelativePathOrUrl($uri) {
return $uri ? Url::fromUri($uri)
->toString() : '';
}