[+BUGFIX] Fluid (View): Refactored TemplateView, which is now automatically backporte...
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / ViewHelpers / RenderViewHelper.php
1 <?php
2
3 /* *
4 * This script belongs to the FLOW3 package "Fluid". *
5 * *
6 * It is free software; you can redistribute it and/or modify it under *
7 * the terms of the GNU Lesser General Public License as published by the *
8 * Free Software Foundation, either version 3 of the License, or (at your *
9 * option) any later version. *
10 * *
11 * This script is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *
14 * General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with the script. *
18 * If not, see http://www.gnu.org/licenses/lgpl.html *
19 * *
20 * The TYPO3 project - inspiring people to share! *
21 * */
22
23 /**
24 *
25 * @version $Id: RenderViewHelper.php 2813 2009-07-16 14:02:34Z k-fish $
26 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
27 * @scope prototype
28 */
29 class Tx_Fluid_ViewHelpers_RenderViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
30
31 /**
32 * Renders the content.
33 *
34 * @param string $section Name of section to render. If used in a layout, renders a section of the main content file. If used inside a standard template, renders a section of the same file.
35 * @param string $partial Reference to a partial.
36 * @param array $arguments Arguments to pass to the partial.
37 * @return string
38 * @author Sebastian Kurf├╝rst <sebastian@typo3.org>
39 * @api
40 */
41 public function render($section = '', $partial = '', $arguments = array()) {
42 if ($partial !== '') {
43 return $this->viewHelperVariableContainer->getView()->renderPartial($partial, $section, $arguments);
44 } elseif ($section !== '') {
45 return $this->viewHelperVariableContainer->getView()->renderSection($section);
46 }
47 return '';
48 }
49
50
51 }
52
53
54 ?>