19 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
20 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
21 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
28 use CompileWithRenderStatic;
35 $this->registerArgument(
'file', \
TYPO3\CMS\Core\Resource\AbstractFile::class,
'',
true);
36 $this->registerArgument(
'returnUrl',
'string',
'',
false,
'');
48 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
50 if (empty($arguments[
'returnUrl'])) {
51 $arguments[
'returnUrl'] = GeneralUtility::getIndpEnv(
'REQUEST_URI');
55 $file = $arguments[
'file'];
58 'target' => $file->getCombinedIdentifier(),
59 'returnUrl' => $arguments[
'returnUrl']
61 $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
62 return (
string)$uriBuilder->buildUriFromRoute(
'file_rename', $params);