Skip to content

Instantly share code, notes, and snippets.

@jaguerra
Created July 10, 2012 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaguerra/3082252 to your computer and use it in GitHub Desktop.
Save jaguerra/3082252 to your computer and use it in GitHub Desktop.
TYPO3 Extbase: Trying to set defaultPid for actions/controllers/plugins not in the current action
protected function setDestinationPidForAction($pid, $actionName, $controllerName = null, $extensionName = null){
if($extensionName === null){
$extensionName = $this->extensionName;
}
if($controllerName === null){
$controllerName = $this->request->getControllerName();
}
$pluginName = Tx_Extbase_Utility_Extension::getPluginNameByAction($extensionName, $controllerName, $actionName);
$frameworkConfiguration = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, $extensionName, $pluginName);
$frameworkConfiguration['view']['defaultPid'] = $pid;
$frameworkConfiguration['extensionName'] = $extensionName;
$frameworkConfiguration['pluginName'] = $pluginName;
$this->configurationManager->setConfiguration($frameworkConfiguration);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment