public function TrumbaBlockBase::convertInputToUriString in Trumba 8
Same name and namespace in other branches
- 2.x src/Plugin/Block/TrumbaBlockBase.php \Drupal\trumba\Plugin\Block\TrumbaBlockBase::convertInputToUriString()
Convert a full url or internal path string to a system Uri.
Parameters
$input:
Return value
string
1 call to TrumbaBlockBase::convertInputToUriString()
- TrumbaBlockBase::blockSubmit in src/
Plugin/ Block/ TrumbaBlockBase.php
File
- src/
Plugin/ Block/ TrumbaBlockBase.php, line 160
Class
- TrumbaBlockBase
- Defines a base block implementation that Trumba blocks plugins will extend.
Namespace
Drupal\trumba\Plugin\BlockCode
public function convertInputToUriString($input) {
$uri = '';
if ($input) {
if ($this
->isExternalUri($input)) {
$uri = Url::fromUri($input)
->toUriString();
}
else {
$uri = Url::fromUserInput($input)
->toUriString();
}
}
return $uri;
}