[TYPO3-mvc] Naming conventions
Ernesto Baschny [cron IT]
ernst at cron-it.de
Thu Sep 24 18:25:55 CEST 2009
Bastian Waidelich schrieb:
> While cleaning up the blog example I bumped upon some issues with the
> current namings in extbase:
>
> Currently the plugin is registered to the global TCA at
> tt_content.list.20.blogexample_pi1
> That is different from the pibase extensions
> tt_content.list.20.indexed_search, tt_content.list.20.tt_address_pi1,
> ... (it should be "blog_example_pi1" insted of "blogexample_pi1").
>
> This leads to the fact, that you can't write:
> t3lib_extMgm::addPiFlexFormValue($_EXTKEY . 'pi1', 'FILE:EXT:...');
>
> anymore in your ext_tables.php. Instead you'll have to do something like
>
> $extensionName = t3lib_div::underscoredToUpperCamelCase($_EXTKEY);
> t3lib_extMgm::addPiFlexFormValue(strtolower($extensionName) . 'pi1',
> 'FILE:EXT:...');
>
> I'd like to change this. And to avoid confusion we came up with
> following naming conventions:
>
> Extension key: blog_example (= $_EXTKEY)
> Extension name: BlogExample (used e.g. in class names)
> Plugin name: MyPlugin
> Plugin key: myplugin (lowercase, no underscores)
> Plugin signature: blog_example_myplugin (used in TypoScript, TCA)
> PluginNamespace: tx_blogexample_myplugin (used to namespace GET/POST vars)
>
> What do you think about this?
I like it! But isn't it what we have already? Only difference is that
instead of having lower(Extension name)+_+Plugin key we add
EXTKEY+_+Plugin key to the static TS-setup to add it to tt_content's
plugin list, right?
> Another issue, is the TS plugin setup..
> Currently it is stored in plugin.tx_blogexample / module.tx_blogexample
> But what if you have multiple plugins?
> Shouldn't that be
> plugin.tx_blogexample_pi1 / module.tx_blogexample_m1
Yes, most extensions coming from kickstarter do it this way.
> But the Configuration manager does not yet support this (it currently
> doesn't know the plugin/module name when loading the settings)
What is the "Configarion manager"?
> And than you'd had to configure each plugin separately - is that a problem?
I am not sure, but I think this has been discussed before. And I must
confess I have no idea about extbase yet and never looked at the blog
example in depth (shame on me!), so these opinions might not fit with
the current status quo:
There are settings that might be generic for all plugins of an
extension, and other settings specific for a specific plugin. I think
something like:
plugin.tx_blogexample = USER
plugin.tx_blogexample.globalSetting = 1
...
plugin.tx_blogexample_pi1 =< plugin.tx_blogexample
plugin.tx_blogexample_pi1.pluginSpecificSetting = abc
...
plugin.tx_blogexample_pi2 =< plugin.tx_blogexample
...
Cheers,
Ernesto
More information about the TYPO3-project-typo3v4mvc
mailing list