File structure
This chapter lists the reserved file and directory names in an extension and file naming conventions.
It should also help you find your way around automatically-generated or example extensions and sitepackages.
The following folder and file structure is typical for a TYPO3 extension:
-
-
...
-
-
-
-
-
-
-
-
<tablename>.php
-
...
-
-
<tablename>.php
-
...
-
-
-
-
...
-
-
-
...
-
-
-
...
-
constants.typoscript
-
setup.typoscript
-
-
-
-
...
-
-
-
-
-
...
-
-
-
...
-
-
-
...
-
-
-
...
-
-
...
-
-
-
...
-
-
-
-
-
...
-
-
-
...
-
-
...
-
Files
An extension consists of:
- A directory named extension key (a worldwide unique
identification string for the extension), located in
typo3conf/for local extensions orext typo3/for system extensions.sysext - Standard files with reserved names for configuration related to TYPO3 (most are optional, see list below)
- Additional files for the main extension functionality.
Reserved file names
Most of these files are not required, except ext_emconf.php
in Classic mode installations not based on Composer
and composer.json in Composer installations.
Note
It is recommended to keep ext_emconf.php and composer.json in
public extensions that are published in the TYPO3 Extension Repository (TER), and
to ensure compatibility with Composer and legacy installations.
Do not use the prefix ext_ in your extension names as this is a reserved name.
Reserved Folders
In the early days, extension authors "baked their own bread" when it came to PHP class file locations, public web resources and templates.
Since the rise of Extbase, a general structure for file
locations inside extensions has become established. If extension authors
stick to this and the Coding Guidelines, many things become easier. For instance, if you put
your PHP classes into a Classes/ folder and use appropriate namespaces for the classes,
the system will autoload the files.
Extension kickstarters like the friendsoftypo3/extension-builder will create the correct structure for you.