[+FEATURE] Fluid (Core): {settings} is available in Partials
authorSebastian Kurfürst <sebastian@typo3.org>
Wed, 22 Sep 2010 06:27:58 +0000 (06:27 +0000)
committerSebastian Kurfürst <sebastian@typo3.org>
Wed, 22 Sep 2010 06:27:58 +0000 (06:27 +0000)
Now, the {settings} are automatically available in partials and sections.
Before, they had to be passed explicitely, i.e. by calling
<f:render section="..." arguments="{settings: settings}" />.

If somebody defined his own "settings"-argument, this still takes precedence:
<f:render section="..." arguments="{settings: some.different.settings}" />
This means that this change is completely backwards compatible.

NOTE: The settings are NOT merged together, like it has been suggested in #6289,
as this will lead to un-obvious behavior for the user.

typo3/sysext/fluid/Classes/ViewHelpers/RenderViewHelper.php

index 9e049a8..2abf4b2 100644 (file)
@@ -39,6 +39,9 @@ class Tx_Fluid_ViewHelpers_RenderViewHelper extends Tx_Fluid_Core_ViewHelper_Abs
         * @api
         */
        public function render($section = NULL, $partial = NULL, $arguments = array()) {
+               if (!isset($arguments['settings'])) {
+                       $arguments['settings'] = $this->templateVariableContainer->get('settings');
+               }
                if ($partial !== NULL) {
                        return $this->viewHelperVariableContainer->getView()->renderPartial($partial, $section, $arguments);
                } elseif ($section !== NULL) {