[Typo3-dev] Getting extension key from tablename

Patrick Rodacker rod at biba.uni-bremen.de
Wed Nov 2 11:28:28 CET 2005


Kasper Skårhøj wrote on 01.11.2005 19:11:
> Table names in extensions - if they follow the rules - are always on the
> form "tx_[extkey-without-underscore]_something_more_maybe". So the segment
> between the first and possibly second understore is - almost - the
> extension key. It means you might have to traverse loaded extension keys,
> remove underscores in their name, then compare with the table name segment
> and if matched, you know the key. Phew.
> 
> Examples:
> 
> Extension key = "myext":
> Tablenames possible: "tx_myext", "tx_myext_something", "tx_myext_foobar"
> 
> Extension key = "your_ext":
> Tablenames possible: "tx_yourext", "tx_yourext_something",
> "tx_yourext_foobar"

Thats a possible solution, but you still have to consider that tables
not following these rules can not be matched this way. In this scenario
the 'tt_news' extension would fail, which could be prevented by matching
against the prefix 'tt_' in addition.

Anyway, I was just wondering if there is some informationen about the
relation of tables and plugins I can rely on.

Thanks so far.
Patrick




More information about the TYPO3-dev mailing list