some value * {oldvariable -> f:format.htmlspecialchars() -> f:variable(name: 'newvariable')} * {oldvariable} * * @see \TYPO3Fluid\Fluid\ViewHelpers\IfViewHelper * @api */ class ReplaceViewHelper extends AbstractViewHelper { public function initializeArguments(): void { $this->registerArgument('value', 'string', 'String to replace in'); $this->registerArgument('search', 'string', 'Search string'); $this->registerArgument('replace', 'string', 'Replace value'); } public function render(): string { $content = $this->arguments['value']; if ($content === null) { $content = $this->renderChildren(); } return str_replace($this->arguments['search'], $this->arguments['replace'], $content); } }