Fluid:
authorSebastian Kurfürst <sebastian@typo3.org>
Sun, 12 Apr 2009 06:55:08 +0000 (06:55 +0000)
committerSebastian Kurfürst <sebastian@typo3.org>
Sun, 12 Apr 2009 06:55:08 +0000 (06:55 +0000)
* Cleaned up TypoScriptViewHelper
* Cleaned up ForViewHelper

typo3/sysext/fluid/Classes/ViewHelpers/ForViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/TypoScriptViewHelper.php

index 0068bce..5693193 100644 (file)
  * @scope prototype
  */
 class Tx_Fluid_ViewHelpers_ForViewHelper extends Tx_Fluid_Core_AbstractViewHelper {
-
-       /**
-        * Arguments initialization
-        *
-        * @return void
-        * @author Sebastian Kurfürst <sebastian@typo3.org>
-        */
-       public function initializeArguments() {
-               //$this->registerArgument('each', 'array', 'The array which is iterated over.', TRUE);
-               //$this->registerArgument('as', 'string', 'Name of the variable where each array element is bound to.', TRUE);
-       }
-
        /**
         * Render.
         *
@@ -53,17 +41,17 @@ class Tx_Fluid_ViewHelpers_ForViewHelper extends Tx_Fluid_Core_AbstractViewHelpe
        public function render($each, $as, $key = '') {
                $out = '';
                if (!empty($each)) {
-                       foreach ($this->arguments['each'] as $keyValue => $singleElement) {
-                               $this->variableContainer->add($this->arguments['as'], $singleElement);
+                       foreach ($each as $keyValue => $singleElement) {
+                               $this->variableContainer->add($as, $singleElement);
                                if (strlen($key)) {
-                                       $this->variableContainer->add($this->arguments['key'], $keyValue);
+                                       $this->variableContainer->add($key, $keyValue);
                                }
                                $out .= $this->renderChildren();
-                               $this->variableContainer->remove($this->arguments['as']);
+                               $this->variableContainer->remove($as);
                                if (strlen($key)) {
-                                       $this->variableContainer->remove($this->arguments['key']);
+                                       $this->variableContainer->remove($key);
                                }
-                       }                       
+                       }
                }
                return $out;
        }
index ff6437b..9841f67 100644 (file)
  * @version $Id:$
  */
 class Tx_Fluid_ViewHelpers_TypoScriptViewHelper extends Tx_Fluid_Core_AbstractViewHelper {
-       /**
-        * The constructor.
-        */
-       public function __construct(array $arguments = array()) {
-       }
-
-       /**
-        * Initializes the arguments of this view helper.
-        *
-        * @author Niels Pardon <mail@niels-pardon.de>
-        */
-       public function initializeArguments() {
-               $this->registerArgument(
-                       'path', 'string', 'The path of the TypoScript object to render.', true
-               );
-       }
 
        /**
         * Renders the TypoScript object in the given TypoScript setup path.
         *
         * @param string the TypoScript setup path of the TypoScript object to render
-        *
         * @return string the content of the rendered TypoScript object
-        *
         * @author Niels Pardon <mail@niels-pardon.de>
         */
        public function render($path) {