[TYPO3-english] Fluid StandaloneView

Alexander Dorn debao84 at googlemail.com
Thu Nov 21 12:53:23 CET 2013


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'));
}


More information about the TYPO3-english mailing list