[TYPO3-english] Naming fields when extending tables

bernd wilke x00nsji02 at sneakemail.com
Thu Apr 2 11:22:28 CEST 2009


Am Wed, 01 Apr 2009 16:45:20 +0200 schrieb Sergio:

> Hi,
> 
> I'm creating my own extension with kickstarter.
> 
> When I try to extend some existing tables adding fields to it, it uses a
> prefix (tx_myextension...) for fields. I would like to avoid this: if I
> add a field named "target" to tt_news extensions, I would like the field
> "target" would be added to the table. Is there a way to do it?

You can do it, but as it is very bad style I don't tell you.

imagine:
your extension extends the record with this field and you use it in your 
intention.
another extension is developed parallel and inserts also a field with the 
name 'target', but uses it in a very own usage (and may have another 
fieldtype).

and then there is a user who wants both extension installed.
no one can tell which type the field has to be. no one can tell which 
value leads to which behavior.

The solution in TYPO3: every extension generates fields with unique 
fieldnames by using the extension key as prefix.

the same with tablenames.

bernd
-- 
http://www.pi-phi.de/t3v4/cheatsheet.html


More information about the TYPO3-english mailing list