public function TrumbaBlockBase::convertUriToAbsolutePathOrUrl in Trumba 8
Same name and namespace in other branches
- 2.x src/Plugin/Block/TrumbaBlockBase.php \Drupal\trumba\Plugin\Block\TrumbaBlockBase::convertUriToAbsolutePathOrUrl()
Convert a saved Uri String to an Absolute path for internal uri's or a full Url for external urls
Parameters
$uri:
Return value
\Drupal\Core\GeneratedUrl|string
3 calls to TrumbaBlockBase::convertUriToAbsolutePathOrUrl()
- TrumbaMainCalendarSpudBlock::build in src/
Plugin/ Block/ TrumbaMainCalendarSpudBlock.php - Builds and returns the renderable array for this block plugin.
- TrumbaOpenSpudBlock::build in src/
Plugin/ Block/ TrumbaOpenSpudBlock.php - Builds and returns the renderable array for this block plugin.
- TrumbaPromoControlSpudBlock::build in src/
Plugin/ Block/ TrumbaPromoControlSpudBlock.php - Builds and returns the renderable array for this block plugin.
File
- src/
Plugin/ Block/ TrumbaBlockBase.php, line 141
Class
- TrumbaBlockBase
- Defines a base block implementation that Trumba blocks plugins will extend.
Namespace
Drupal\trumba\Plugin\BlockCode
public function convertUriToAbsolutePathOrUrl($uri) {
return $uri ? Url::fromUri($uri)
->setAbsolute()
->toString() : '';
}