Main classes and methods

There are a number of core classes in TYPO3 which contain general functionality and are available most of or even all the time. These classes are either static or exist as singletons stored in global variables.

This table lists some of the most important classes to know about in TYPO3:

Class name Description Usage
\TYPO3\CMS\Core\Database\DatabaseConnection

Database Abstraction Base API

All access to the database must go through this object. That is the first step towards DBAL compliance in your code. The class contains MySQL wrapper functions which can almost be search/replaced with your existing calls.

Available as $GLOBALS['TYPO3_DB'] in both frontend and backend
\TYPO3\CMS\Core\Charset\CharsetConverter

Character Set handling API

Contains native PHP code to handle character set conversion based on charset tables from Unicode.org. You should use this class whenever you need to handle character set conversion or to perform multibyte-safe string operations (like getting the length, cropping, etc.).

In the backend, available as $GLOBALS[‘LANG’]->csConvObj

In the frontend, available as $GLOBALS[‘TSFE’]->csConvObj

\TYPO3\CMS\Core\Utility\GeneralUtility

General Purpose Functions

A collection of multi-purpose PHP functions. Some are TYPO3 specific but not all.

There are more specific utility classes in EXT:core/Classes/Utility.

Static class, call methods using \TYPO3\CMS\Core\Utility\GeneralUtility::
\TYPO3\CMS\Backend\Utility\BackendUtility

Backend Specific Functions

Contains functions specific to the TYPO3 backend. You will typically need these when programming backend modules or other backend functionality.

This class is NOT available in the frontend!

Static class, call methods using \TYPO3\CMS\Backend\Utility\BackendUtility::
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility

Extension API functions

Functions for extensions to interface with the core system. Many of these functions are used in ext\_localconf.php and ext\_tables.php files of extensions. They let extensions register their features with the system.

Static class, call methods using \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::
\TYPO3\CMS\Backend\Utility\IconUtility

Icons / Part of skinning API

Contains a few functions for getting the right icon for a database table record or the skinned version of any other icon.

This class is NOT available in the frontend!

Static class, call methods using \TYPO3\CMS\Backend\Utility\IconUtility::
\TYPO3\CMS\Backend\Template\DocumentTemplate

Backend Template Class

Contains functions for producing the layout of backend modules, setting up HTML headers, wrapping JavaScript sections correctly for XHTML, etc.

Available as $GLOBALS['TBE_TEMPLATE'], $GLOBALS['SOBE'] or $this->doc (inside of BE modules)

These classes are always included and available in the TYPO3 backend and frontend (except \TYPO3\CMS\Backend\Utility\BackendUtility and \TYPO3\CMS\Backend\Utility\IconUtility).

The next sections highlight a selection of methods from these classes. They were chosen for their general importance with regards to the whole of TYPO3. You should at least acquaint yourself with all these high- priority functions, in order to write code the TYPO3 way. These lists also include some other methods selected for their usefulness.