TYPO3 API  SVNRelease
RenderingContext.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*                                                                        *
00004  * This script belongs to the FLOW3 package "Fluid".                      *
00005  *                                                                        *
00006  * It is free software; you can redistribute it and/or modify it under    *
00007  * the terms of the GNU Lesser General Public License as published by the *
00008  * Free Software Foundation, either version 3 of the License, or (at your *
00009  * option) any later version.                                             *
00010  *                                                                        *
00011  * This script is distributed in the hope that it will be useful, but     *
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
00013  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
00014  * General Public License for more details.                               *
00015  *                                                                        *
00016  * You should have received a copy of the GNU Lesser General Public       *
00017  * License along with the script.                                         *
00018  * If not, see http://www.gnu.org/licenses/lgpl.html                      *
00019  *                                                                        *
00020  * The TYPO3 project - inspiring people to share!                         *
00021  *                                                                        */
00022 
00023 /**
00024  *
00025  *
00026  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
00027  */
00028 class Tx_Fluid_Core_Rendering_RenderingContext implements Tx_Fluid_Core_Rendering_RenderingContextInterface {
00029 
00030     /**
00031      * Template Variable Container. Contains all variables available through object accessors in the template
00032      *
00033      * @var Tx_Fluid_Core_ViewHelper_TemplateVariableContainer
00034      */
00035     protected $templateVariableContainer;
00036 
00037     /**
00038      * Object manager which is bubbled through. The ViewHelperNode cannot get an ObjectManager injected because
00039      * the whole syntax tree should be cacheable
00040      *
00041      * @var Tx_Extbase_Object_ObjectManagerInterface
00042      */
00043     protected $objectManager;
00044 
00045     /**
00046      * Controller context being passed to the ViewHelper
00047      *
00048      * @var Tx_Extbase_MVC_Controller_ControllerContext
00049      */
00050     protected $controllerContext;
00051 
00052     /**
00053      * ViewHelper Variable Container
00054      *
00055      * @var Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer
00056      */
00057     protected $viewHelperVariableContainer;
00058 
00059     /**
00060      * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
00061      * @author Sebastian Kurfürst <sebastian@typo3.org>
00062      */
00063     public function injectObjectManager(Tx_Extbase_Object_ObjectManagerInterface $objectManager) {
00064         $this->objectManager = $objectManager;
00065         $this->templateVariableContainer = $this->objectManager->create('Tx_Fluid_Core_ViewHelper_TemplateVariableContainer');
00066         $this->viewHelperVariableContainer = $this->objectManager->create('Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer');
00067     }
00068 
00069     /**
00070      * Returns the object manager. Only the ViewHelperNode should do this.
00071      *
00072      * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
00073      * @author Sebastian Kurfürst <sebastian@typo3.org>
00074      */
00075     public function getObjectManager() {
00076         return $this->objectManager;
00077     }
00078 
00079     /**
00080      * Injects the template variable container containing all variables available through ObjectAccessors
00081      * in the template
00082      *
00083      * @param Tx_Fluid_Core_ViewHelper_TemplateVariableContainer $templateVariableContainer The template variable container to set
00084      * @author Sebastian Kurfürst <sebastian@typo3.org>
00085      */
00086     public function setTemplateVariableContainer(Tx_Fluid_Core_ViewHelper_TemplateVariableContainer $templateVariableContainer) {
00087         $this->templateVariableContainer = $templateVariableContainer;
00088     }
00089 
00090     /**
00091      * Get the template variable container
00092      *
00093      * @return Tx_Fluid_Core_ViewHelper_TemplateVariableContainer The Template Variable Container
00094      * @author Sebastian Kurfürst <sebastian@typo3.org>
00095      */
00096     public function getTemplateVariableContainer() {
00097         return $this->templateVariableContainer;
00098     }
00099 
00100     /**
00101      * Set the controller context which will be passed to the ViewHelper
00102      *
00103      * @param Tx_Extbase_MVC_Controller_ControllerContext $controllerContext The controller context to set
00104      * @author Sebastian Kurfürst <sebastian@typo3.org>
00105      */
00106     public function setControllerContext(Tx_Extbase_MVC_Controller_ControllerContext $controllerContext) {
00107         $this->controllerContext = $controllerContext;
00108     }
00109 
00110     /**
00111      * Get the controller context which will be passed to the ViewHelper
00112      *
00113      * @return Tx_Extbase_MVC_Controller_ControllerContext The controller context to set
00114      * @author Sebastian Kurfürst <sebastian@typo3.org>
00115      */
00116     public function getControllerContext() {
00117         return $this->controllerContext;
00118     }
00119 
00120     /**
00121      * Set the ViewHelperVariableContainer
00122      *
00123      * @param Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer $viewHelperVariableContainer
00124      * @return void
00125      * @author Sebastian Kurfürst <sebastian@typo3.org>
00126      */
00127     public function setViewHelperVariableContainer(Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer $viewHelperVariableContainer) {
00128         $this->viewHelperVariableContainer = $viewHelperVariableContainer;
00129     }
00130 
00131     /**
00132      * Get the ViewHelperVariableContainer
00133      *
00134      * @return Tx_Fluid_Core_ViewHelper_ViewHelperVariableContainer
00135      * @author Sebastian Kurfürst <sebastian@typo3.org>
00136      */
00137     public function getViewHelperVariableContainer() {
00138         return $this->viewHelperVariableContainer;
00139     }
00140 }
00141 ?>