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

Bastian Waidelich bastian at typo3.org
Mon Nov 15 11:52:59 CET 2010


Franz Koch wrote:

Hi again ;)

> Not sure if I got you right. You like to drop the default
> action/controller as well as the switchable ones and fetch those from
> the PHP configuration directly?

The default controller & action is currently not used anyways (it was 
only kept in the TS for backwards compatibility).
Yes I'd like to move them to a global PHP configuration (see below). 
$GLOBALS are not nice, but we're using them in v4 all over the place 
(and it's better than static classes/methods IMO - at least they're 
making it testable).


> They at least can't be moved to  plugin.tx_blogexample, as those are always plugin specific
> and not valid for any plugin of the extension.

That's right. And we need to have the possibility to find a plugin by 
extensionName, controller & action. This would be an expensive operation 
if we'd have to iterate through all "plugin." configuration.

> But it still has to be possible to override the "global"
> plugin settings per plugin definition (imagine TS-only instances).

That's a good point, but that should work anyways:

blogexample_bloglist = USER
blogexample_bloglist {
	userFunc = tx_extbase_core_bootstrap->run
	pluginName = BlogList
	extensionName = BlogExample
	settings.foo = bar
	switchableControllerActions.Blog.actions = foo,bar
}

By specifying plugin and extension name, the bootstrap could fetch the 
configured controller/action pairs and they could be overridden just 
like in the flexform (it will only be allowed to change the order, you 
won't be able to add new actions here).

My suggestion for a global registry would be:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'] = array(
   'extbase' => array(
     'extensions' => array(
       '<ExtensionName>' => array(
         '<PluginName1>' => array(
           array(
             '<Controller1>' => array('<action1>', '<action2>'),
             '<Controller2>' => array('<action3>'),
           )
         ),
         '<PluginName2>' => array(
           array(
             '<Controller1>' => array('<action1>', '<action2>'),
             '<Controller2>' => array('<action3>'),
           ),
           array(
             '<Controller1>' => array('<nonCachableAction1>')
           )
         ),
       ),
     ),
   ),
);

Does that make sense?
Bastian


More information about the TYPO3-project-typo3v4mvc mailing list