FluidTYPO3\Vhs\ViewHelpers\Format\SanitizeStringViewHelper::renderStatic PHP Method

renderStatic() public static method

public static renderStatic ( array $arguments, Closure $renderChildrenClosure, TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext ) : mixed
$arguments array
$renderChildrenClosure Closure
$renderingContext TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface
return mixed
    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
    {
        $string = $arguments['string'];
        if (null === $string) {
            $string = $renderChildrenClosure();
            if (null === $string) {
                return null;
            }
        }
        $characterMap = static::$characterMap;
        $customMap = $arguments['customMap'];
        if (true === is_array($customMap) && 0 < count($customMap)) {
            $characterMap = array_merge($characterMap, $customMap);
        }
        $specialCharsSearch = array_keys($characterMap);
        $specialCharsReplace = array_values($characterMap);
        $string = str_replace($specialCharsSearch, $specialCharsReplace, $string);
        $string = strtolower($string);
        $pattern = '/([^a-z0-9\\-]){1,}/';
        $string = preg_replace($pattern, '-', $string);
        return trim($string, '-');
    }
SanitizeStringViewHelper