2 namespace TYPO3\CMS\Scheduler\ViewHelpers
;
5 * This file is part of the TYPO3 CMS project.
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
14 * The TYPO3 project - inspiring people to share!
17 use TYPO3\CMS\Core\Utility\GeneralUtility
;
18 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface
;
19 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper
;
20 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic
;
23 * Edit Record ViewHelper, see FormEngine logic
27 class EditRecordViewHelper
extends AbstractViewHelper
29 use CompileWithRenderStatic
;
32 * Initializes the arguments
34 public function initializeArguments()
36 $this->registerArgument('parameters', 'string', 'Is a set of GET params to send to FormEngine', true);
40 * Returns a URL to link to FormEngine
42 * @param array $arguments
43 * @param \Closure $renderChildrenClosure
44 * @param RenderingContextInterface $renderingContext
46 * @see \TYPO3\CMS\Backend\Routing\UriBuilder::buildUriFromRoute()
47 * @return string URL to FormEngine module + parameters
48 * @throws \TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException
50 public static function renderStatic(array $arguments, \Closure
$renderChildrenClosure, RenderingContextInterface
$renderingContext)
52 $parameters = GeneralUtility
::explodeUrl2Array($arguments['parameters']);
53 /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
54 $uriBuilder = GeneralUtility
::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder
::class);
55 return (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);