<?php

namespace Internetgalerie\IgDatapoolFe\ViewHelpers\Uri;

use Closure;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;

class ActionViewHelper extends \Internetgalerie\IgCoreViewhelpers\ViewHelpers\Uri\ActionViewHelper
{
    /**
     * @param array $arguments
     * @param Closure $renderChildrenClosure
     * @param RenderingContextInterface $renderingContext
     * @return string
     */
    public static function renderStatic(array $arguments, Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
    {
        // convert _ to @, stupid fluid parser...
        foreach ($arguments as $key => $arg) {
            if (str_starts_with($key, '_')) {
                $arguments['@' . ltrim($key, '_')] = $arg;
                unset($arguments[$key]);
            }
        }
        return parent::renderStatic($arguments, $renderChildrenClosure, $renderingContext);
        //$arguments = \Internetgalerie\IgDatapoolFe\Utility\NeedfulThings::keepAndOverrideArgs($arguments, $controllerContext->getRequest());
    }
}
