Core API

2.1.5. Naming conventions

Based on the extension key of an extension these naming conventions should be followed:

 

General

Example

User specific

Example

Extension key

(Lowercase "alnum" + underscores. )

Assigned by the TYPO3 Extension Repository.

cool_shop

Determined by yourself, but prefixed "user_"

user_my_shop

Database tables and fields

Prefix with "tx_[key]_" where key is without underscores!

Prefix: tx_coolshop_

Examples:

tx_coolshop_products

tx_coolshop_categories

Prefix with "[key]_"

Prefix: user_my_shop_

Examples:

user_my_shop_products

user_my_shop_categories

Backend module

(Names are always without underscores!)

Name: The extension key name without underscores, prefixed "tx"

txcoolshop

Name: No underscores, prefixed "u"

uMyShop or umyshop or ...

Frontend PHP classes

(Same as database tables and fields. Prepend class file names "class." though.)

 

Best practice on using underscores

If you study the naming conventions above closely you will find that they are complicated due to varying rules for underscores in keynames; Sometimes the underscores are stripped off, sometimes not.

The best practice you can follow is to not use underscores in your extensions keys at all! That will make the rules simpler. This is highly encouraged.

Note on "old" and default extensions:

Some the "classic" extensions from before the extension structure came about does not comply with these naming conventions. That is an exception made for backwards compatibility. The assignment of new keys from the TYPO3 Extension Repository will make sure that any of these old names are not accidentially reassigned to new extensions.

Further, some of the classic plugins (tt_board, tt_guest etc) users the "user_" prefix for their classes as well.

To top


Valid XHTML 1.0!