17 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
18 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
19 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
48 use CompileWithRenderStatic;
57 $this->registerArgument(
'uri',
'string',
'target URI',
true);
58 $this->registerArgument(
'defaultScheme',
'string',
'scheme the href attribute will be prefixed with if specified $uri does not contain a scheme already',
false,
'http');
68 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
70 $uri = $arguments[
'uri'];
71 $defaultScheme = $arguments[
'defaultScheme'];
73 $scheme = parse_url($uri, PHP_URL_SCHEME);
74 if ($scheme ===
null && $defaultScheme !==
'') {
75 $uri = $defaultScheme .
'://' . $uri;