[TASK] Move arguments to initializeArguments() in HtmlVH in ext:fluid 23/48923/2
authorRoberto Torresani <erreti@gmail.com>
Tue, 12 Jul 2016 09:58:40 +0000 (11:58 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Tue, 19 Jul 2016 05:20:19 +0000 (07:20 +0200)
Move the argument registrations away from the render() method
to initializeArguments(), to prevent any errors with PHP7 and
subclassed ViewHelpers if/when render() method signatures change

Resolves: #77060
Releases: master
Change-Id: Ie121184e6a33fea5e9fe2086ed5aafafbc6b6f36
Reviewed-on: https://review.typo3.org/48923
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Anna Färber <anna.faerber@dkd.de>
Tested-by: Anna Färber <anna.faerber@dkd.de>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlViewHelper.php

index 88cf715..e1b5209 100644 (file)
@@ -74,11 +74,22 @@ class HtmlViewHelper extends AbstractViewHelper
     protected $escapeOutput = false;
 
     /**
-     * @param string $parseFuncTSPath path to TypoScript parseFunc setup.
+     * Initialize arguments.
+     *
+     * @api
+     * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
+     */
+    public function initializeArguments()
+    {
+        $this->registerArgument('parseFuncTSPath', 'string', ' path to TypoScript parseFunc setup.', false, 'lib.parseFunc_RTE');
+    }
+
+    /**
      * @return string the parsed string.
      */
-    public function render($parseFuncTSPath = 'lib.parseFunc_RTE')
+    public function render()
     {
+        $parseFuncTSPath = $this->arguments['parseFuncTSPath'];
         return static::renderStatic(
             array(
                 'parseFuncTSPath' => $parseFuncTSPath,