[TYPO3-mvc] RFC #10666: Allow plugins to be registered as new content element

Bastian Waidelich bastian at typo3.org
Sun Nov 14 17:57:36 CET 2010


Marc Bastian Heinrichs wrote:

Hi Marc,

> Problem:
> Tx_Extbase_Utility_Extension::configurePlugin (ext_localconf.php) and
> Tx_Extbase_Utility_Extension::registerPlugin (ext_tables.php)
> allow to register plugins as list_type only.

> Solution:
> Add options to support CType also.

Thanks for your patch, this would indeed be an important feature.
There are a few issues though:
First of all I don't like the fact, that you'd have to specify the CType 
in the configure- and in the registerPlugin calls. I don't know a good 
solution atm, but this would be quite error prone I'd say.

And, secondly, as you guys have already discussed: There are still a few 
places where Extbase relies on the configuration to be stored at 
tt_content.list.20..
Since we now have dependency injection and an improved 
ConfigurationManager, we can access the current framework configuration 
even in static methods like:

$objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
$configurationManager = 
$objectManager->get('Tx_Extbase_Configuration_ConfigurationManagerInterface');
$configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);

As second and third parameter of the getConfiguration() method you can 
specify extension and plugin name in order to retrieve configuration for 
another plugin than the current.

The problem is, that the framework configuration does not contain the 
switchableController part which we need in 
Tx_Extbase_Utility_Extension::getPluginNameByAction() for example.
Maybe a global registration, that holds the switchableControllers for a 
plugin, would really be the best solution..
If I'm right the tt_content part could then reduced from

blogexample_bloglist = USER
blogexample_bloglist {
	userFunc = tx_extbase_core_bootstrap->run
	pluginName = BlogList
	extensionName = BlogExample
	controller = Blog
	action = index
	switchableControllerActions {
		Blog
			actions = index
		}
	}
	settings = < plugin.tx_blogexample.settings
	persistence = < plugin.tx_blogexample.persistence
	view = < plugin.tx_blogexample.view
	_LOCAL_LANG = < plugin.tx_blogexample._LOCAL_LANG
}

to

blogexample_bloglist = USER
blogexample_bloglist {
	userFunc = tx_extbase_core_bootstrap->run
	pluginName = BlogList
	extensionName = BlogExample
}


What do you think?

Best,
Bastian


More information about the TYPO3-project-typo3v4mvc mailing list