[TYPO3-mvc] Partial template from other extensions

arno dudek webmaster at adgrafik.at
Tue Apr 26 18:32:58 CEST 2011


Hi Bastian!

Thanks for the answer.
I found another solution which will be better for extending. Now the 
main-controller calls diffrent "sub-controllers" which will do what I want.

But I'm not sure if this is the right way to call a controller. But it 
works ;) If there is a better way to do this let me know.

// Execute template controllers.
$templateControllerClassNames = explode(',', $map->getTemplates());
foreach ($templateControllerClassNames as $templateControllerClassName) {
	// Get class and action name
	@list($templateControllerClassName, $templateControllerActionName) = 
explode('::', $templateControllerClassName);
	if (class_exists($templateControllerClassName) === FALSE) {
		$this->flashMessageContainer->add('Template controller class "' . 
$templateControllerClassName . '" not exists.');
		continue;
	}

	$templateController = 
t3lib_div::makeInstance($templateControllerClassName);
	$templateController->injectConfigurationManager($this->configurationManager);
	$templateController->injectPropertyMapper($this->propertyMapper);
	$templateController->injectObjectManager($this->objectManager);
	$templateController->injectValidatorResolver($this->validatorResolver);
	$templateController->injectFlashMessageContainer($this->flashMessageContainer);
	$templateController->injectReflectionService($this->reflectionService);
	$templateController->injectMapBuilder($mapBuilder);
	$templateRequest = t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Request');
	$templateRequest->setControllerObjectName($templateControllerClassName);
	$templateRequest->setControllerActionName($templateControllerActionName);
	$templateController->processRequest($templateRequest, $this->response);
}

lg arno

Am 26.04.11 09:28, schrieb Bastian Waidelich:
> arno dudek wrote:
>
> Hi Arno,
>
>> Is there a posibility to parse partials of an other extension or must I
>> load and parse a "normal" template from the other extension?
>
> You can't specify another extension in the render view helper. Instead
> you could override the partial root path and set it to the same directory:


More information about the TYPO3-project-typo3v4mvc mailing list