---
title: "ext_tables.php"
manual: "TYPO3 Explained"
version: "11.5"
permalink: "https://docs.typo3.org/permalink/t3coreapi:ext-tables-php@11.5"
source: "ExtensionArchitecture/FileStructure/ExtTables.rst"
rendered: "2026-10-21T15:30:00+00:00"
---

> [!WARNING]
> **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](https://typo3.com/services/extended-support-elts).

# `ext_tables.php` {#ext-tables-php}

*-- optional*

`ext_tables.php` is *not* always included in the global scope of the
frontend context.

This file is only included when

-   a TYPO3 Backend or CLI request is happening
-   or the TYPO3 Frontend is called and a valid backend user is authenticated

This file usually gets included later within the request and after TCA
information is loaded, and a backend user is authenticated.

> [!TIP]
> **Hint**
>
> In many cases, the file `ext_tables.php` is no longer needed,
> since `TCA` definitions must be placed in files located at
> [Configuration/TCA/](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-tca@11.5).

## Should not be used for {#should-not-be-used-for}

-   TCA configurations for new tables.
    They should go in [Configuration/TCA/sometable.php](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-tca@11.5).
-   TCA overrides of existing tables. They should go in
    [Configuration/TCA/Overrides/somefile.php](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-tca-overrides@11.5).
-   calling `ExtensionManagementUtility::addToInsertRecords()`
    as this might break the frontend. They should go in
    [Configuration/TCA/Overrides/somefile.php](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-tca-overrides@11.5).
-   calling `ExtensionManagementUtility::addStaticFile()`
    as this might break the frontend. They should go in
    `Configuration/TCA/Overrides/sys_template.php`

## Should be used for {#should-be-used-for}

These are the typical functions that should be placed inside `ext_tables.php`

-   Registering of [backend modules](https://docs.typo3.org/permalink/t3coreapi:backend-modules-api@11.5) or adding a new
    main module [Example](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-files-backend-module@11.5)
-   Adding table options via `ExtensionManagementUtility::allowTableOnStandardPages()`
    [Example](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-files-allow-table-standard@11.5)
-   Registering a scheduler tasks:
    [Registering a scheduler task](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-files-scheduler@11.5)
-   Assignments to the global configuration arrays `$GLOBALS['TBE_STYLES']`
    and `$GLOBALS['PAGES_TYPES']`
-   Extending the [Backend user settings](https://docs.typo3.org/permalink/t3coreapi:user-settings-extending@11.5)

## Examples {#examples}

Put the following in a file called `ext_tables.php` in the main directory
of your extension. The file does not need to be registered but will be loaded
automatically:

**EXT:site_package/ext_tables.php**

```php
<?php
// all use statements must come first
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

(function () {
  // Add your code here
})();
```

### Registering a backend module {#extension-configuration-files-backend-module}

You can register a new backend module for your extension via `ExtensionUtility::registerModule()`:

**EXT:my_extension/ext_tables.php**

```php
// use TYPO3\CMS\Extbase\Utility\ExtensionUtility;

ExtensionUtility::registerModule(
   'ExtensionName', // Extension Name in CamelCase
   'web', // the main module
   'mysubmodulekey', // Submodule key
   'bottom', // Position
   [
       'MyController' => 'list,show,new',
   ],
   [
       'access' => 'user,group',
       'icon'   => 'EXT:my_extension/ext_icon.svg',
       'labels' => 'LLL:EXT:my_extension/Resources/Private/Language/locallang_statistics.xlf',
   ]
);
```

There is also a possibility to register modules without Extbase, using core functionality only.
For more information on backend modules see [backend module API](https://docs.typo3.org/permalink/t3coreapi:backend-modules-api@11.5).

### Allowing a tables records to be added to Standard pages {#extension-configuration-files-allow-table-standard}

By default new records of tables may only be added to Sysfolders in TYPO3. If you need to allow
new records of your table to be added on Standard pages call:

**EXT:site_package/ext_tables.php**

```php
// use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

ExtensionManagementUtility::allowTableOnStandardPages(
   'tx_myextension_domain_model_mymodel'
);
```

Read [why the check for the TYPO3 constant is necessary](https://docs.typo3.org/permalink/t3coreapi:globals-constants-typo3@11.5).

### Registering a scheduler task {#extension-configuration-files-scheduler}

Scheduler tasks get registered in the ext_tables.php as well. Note that the Sysext "scheduler" has
to be installed for this to work.

**EXT:site_package/ext_tables.php**

```php
// use TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionTask;
// use TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionAdditionalFieldProvider;

// Add caching framework garbage collection task
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][CachingFrameworkGarbageCollectionTask::class] = array(
     'extension' => 'your_extension_key',
     'title' => 'LLL:EXT:your_extension_key/locallang.xlf:cachingFrameworkGarbageCollection.name',
     'description' => 'LLL:EXT:your_extension_key/locallang.xlf:cachingFrameworkGarbageCollection.description',
     'additionalFields' => \CachingFrameworkGarbageCollectionAdditionalFieldProvider::class
);
```

For more information see the documentation of the Sys-Extension scheduler.
