[TYPO3-english] Fluid StandaloneView

Wido Widlewski typo3 at websimplex.de
Thu Nov 21 15:40:12 CET 2013


Hi Alexander,

maybe the objectManager is not loaded?

I used something like that:

if (!isset($this->objectManager)) {
	$this->objectManager = 
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\TYPO3\CMS\Extbase\Object\ObjectManager');
}

// create Fluid Standalone View
$view = 
$this->objectManager->create('\TYPO3\CMS\Fluid\View\StandaloneView');


Good Luck,

Wido


> Hello,
>
> I got a problem using the Fluid StandaloneView with TYPO3 6.1. I want to render a certain template section or partial for an AJAX-call.
>
> I modified the code found here.
>
> It would be awesome if someone could help.
> Thank You
>
> Regards
> Alexander
>
> Description of problem:
>
> Inheritance of StandaloneView:
> StandaloneView extends \TYPO3\CMS\Fluid\View\AbstractTemplateView which implements \TYPO3\CMS\Extbase\Mvc\View\ViewInterface.
>
> When debugging the code below I get the following error:
> __clone method called on non-object in /Volumes/www/b2bhomer/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php on line 227
>
> The error appears when calling $ajaxView->renderSection().
>
> This line here always returns NULL which leads to the error above.
> $renderingContext = $this->getCurrentRenderingContext();
>
> public function apartmentListAction() {
>
> 		/* @var $ajaxView \TYPO3\CMS\Fluid\View\StandaloneView */
> 		$ajaxView = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
>
> 		$extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
> 		$templateRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']);
> 		$partialRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['view']['partialRootPath']);
>
> 		$templatePathAndFilename = $templateRootPath . '/Apartment/List.html';
> 		$ajaxView->setTemplatePathAndFilename($templatePathAndFilename);
> 		$ajaxView->setPartialRootPath($partialRootPath);
>
> 		$ajaxView->assign($templatePathAndFilename, $templateRootPath);
> 		$ajaxView->assign('apartments', $this->apartmentRepository->findAll());
>
> 		return $ajaxView->renderSection('ajax', array('viewMode', 'listView'));
> }
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>
>



More information about the TYPO3-english mailing list