Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
Create an extension
For an extension to be installable in TYPO3 it needs a file called
composer.
. You can read more about this file here:
composer.json.
A minimal composer.
to get the extension up and running
could look like this:
{
"name": "ttn/tea",
"description": "TYPO3 example extension for unit testing and best practices",
"type": "typo3-cms-extension",
"authors": [
{
"name": "Oliver Klee",
"email": "typo3-coding@oliverklee.de",
"homepage": "https://www.oliverklee.de",
"role": "developer"
}
],
"homepage": "https://extensions.typo3.org/extension/tea/",
"support": {
"issues": "https://github.com/TYPO3-Documentation/tea/issues",
"source": "https://github.com/TYPO3-Documentation/tea",
"docs": "https://docs.typo3.org/p/ttn/tea/main/en-us/"
},
"require": {
"php": "~7.4.0 || ~8.0.0 || ~8.1.0",
"typo3/cms-core": "^11.5.2 || ^12.0@dev",
"typo3/cms-extbase": "^11.5.2 || ^12.0@dev",
"typo3/cms-fluid": "^11.5.2 || ^12.0@dev",
"typo3/cms-frontend": "^11.5.2 || ^12.0@dev"
},
"prefer-stable": true,
"autoload": {
"psr-4": {
"TTN\\Tea\\": "Classes/"
}
},
"extra": {
"typo3/cms": {
"extension-key": "tea"
}
}
}
<?php
$EM_CONF[$_EXTKEY] = [
'title' => 'Tea example',
'description' => 'Example extension for unit testing and best practices',
'version' => '2.0.0',
'category' => 'example',
'constraints' => [
'depends' => [
'php' => '8.0.0-8.1.99',
'typo3' => '11.5.0-12.4.99',
'extbase' => '11.5.0-12.4.99',
'fluid' => '11.5.0-12.4.99',
'frontend' => '11.5.0-12.4.99',
],
],
'state' => 'stable',
'uploadfolder' => false,
'createDirs' => '',
'author' => 'Oliver Klee',
'author_email' => 'typo3-coding@oliverklee.de',
'author_company' => 'TYPO3 Trainer Network',
'autoload' => [
'psr-4' => [
'TTN\\Tea\\' => 'Classes/',
],
],
'autoload-dev' => [
'psr-4' => [
'TTN\\Tea\\Tests\\' => 'Tests/',
],
],
];
Hint
If the extension should also be available for legacy installations it
also needs a file called ext_
. This file
contains roughly the same information in a different format. Have a look
at the tab "Legacy" above.
With just the composer.
present (and for legacy installations additionally
ext_
) you would be able to install the extension
but it would not do anything.
Though not required it is considered best practice for an extension to have an
icon. This icon should have the format .svg
or .png
and has
to be located at EXT:
.