TYPO3  7.6
RenderViewHelper.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Fluid\ViewHelpers;
3 
4 /* *
5  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * The TYPO3 project - inspiring people to share! *
12  * */
13 
17 
77 {
88  public function render($section = null, $partial = null, $arguments = array(), $optional = false)
89  {
90  return static::renderStatic(
91  array(
92  'section' => $section,
93  'partial' => $partial,
94  'arguments' => $arguments,
95  'optional' => $optional,
96  ),
98  $this->renderingContext
99  );
100  }
101 
111  {
112  $section = $arguments['section'];
113  $partial = $arguments['partial'];
114  $optional = $arguments['optional'];
115  $arguments = static::loadSettingsIntoArguments($arguments['arguments'], $renderingContext);
116 
118  if ($partial !== null) {
119  return $viewHelperVariableContainer->getView()->renderPartial($partial, $section, $arguments);
120  } elseif ($section !== null) {
121  return $viewHelperVariableContainer->getView()->renderSection($section, $arguments, $optional);
122  }
123 
124  return '';
125  }
126 
135  {
137  if (!isset($arguments['settings']) && $templateVariableContainer->exists('settings')) {
138  $arguments['settings'] = $templateVariableContainer->get('settings');
139  }
140  return $arguments;
141  }
142 }