Beispiel #1
0
 /**
  * Build a fluid renderer object
  *
  * @return TYPO3\CMS\Fluid\View\TemplateView
  */
 protected static function getFluidRenderer()
 {
     if (!self::$fluidRenderer) {
         $objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
         self::$fluidRenderer = $objectManager->get('TYPO3\\CMS\\Fluid\\View\\TemplateView');
         $controllerContext = $objectManager->get('Tx_PtExtlist_Extbase_ExtbaseContext')->getControllerContext();
         self::$fluidRenderer->setControllerContext($controllerContext);
     }
     return self::$fluidRenderer;
 }
 /**
  * Initialize Fluid Renderer (which is a Fluid view)
  */
 protected function initFluidRenderer()
 {
     if (!$this->fluidRenderer) {
         $request = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Request');
         /* @var $request \TYPO3\CMS\Extbase\Mvc\Request */
         $request->setControllerExtensionName($this->extensionName);
         $request->setPluginName($this->pluginName);
         $this->fluidRenderer = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\TemplateView');
         $controllerContext = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext');
         $controllerContext->setRequest($request);
         $this->fluidRenderer->setControllerContext($controllerContext);
     }
 }
 /**
  * Sets the current controller context
  *
  * @param \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext Controller context which is available inside the view
  * @return void
  * @api
  */
 public function setControllerContext(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 {
     $this->templateView->setControllerContext($controllerContext);
 }