[TYPO3-ect] RFC: Common prefixId for several controllers

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Jan 15 15:13:02 CET 2007


Hi Elmar,

Elmar HInz wrote: on 12.01.2007 10:00:

> testing the conception of lib/div by the eFAQ project, I come to a point
> where the concept needs some refinement and I am looking for an
> appropriate term now. 
> 
> The TYPO3 coding guidelines for extensions require that all parameters of
> a plugin are handled within one array for some reasons. I don't know them
> in detail.

So that you don't clash with parameters of other extensions/plugins that
are placed on the same page. Having a namespace per plugin makes that
clash impossible.

> The Kickstarter generates the line:
> 
> var $prefixId      = 'tx_test_pi1';        // Same as class name
> 
> resulting in URLs parameters like:
> 
> tx_test_pi1[table]=tt_content&tx_test_pi1[uid]=7
> 
> Also lib/div uses the controllers classname for this prefix. So far.
> 
> Now I want to put multiple plugins into the same page, that react to the
> same form parameters. Giving each of the plugins it's own controller
> class, the solution above comes to it's limits, because they have
> different classnames. So I need to choose a common prefixId for the
> multiple plugins of this setup.

In my "Baschny MVC" variant I have just one "frontend plugin controller"
per extension so I don't have that problem. That frontend plugin
controller chooses the controller/view to execute/load based on
TypoScript and GPvars.

So I would recommend trying to find a way to have a single prefixId per
extension in your lib/div solution.

> Question 1: 
> 
> Does anybody of the core developers know, what side effects
> that may have be, if any?

I think only pi_base is affected by that specific prefix. So that is
easy to generate links in pi_base derived classes. So changing that to
anything else shouldn't matter to TYPO3 as a whole. Only have in mind
RealURL setups so that they are still possible. The suggestion of Daniel
Brüßler (having the tt_content-uid in the prefix) would make setting up
RealURL much more annoying.

> Question 2:
> 
> The varibale name $prefixId is a little unspecific and a want to give it a
> more precise name within lib/div. My own idea is $parameterPrefix. Any
> better suggestions?

You came up with "$designator" but if you think that you have one
designator per extension, you could as well use the extension key as the
"designator" and call it what it really is: $extensionKey.

Cheers,
Ernesto


More information about the TYPO3-team-extension-coordination mailing list