.. include:: /Includes.rst.txt .. _cgl-file-structure: ============== File Structure ============== TYPO3 files use the following structure: #. Opening PHP tag (including strict_types declaration) #. Copyright notice #. Namespace #. Namespace imports #. Class information block in phpDoc format #. PHP class #. Optional module execution code The following sections discuss each of these parts. Namespace ========= The namespace declaration of each PHP file in the TYPO3 Core shows where the file belongs inside TYPO3 CMS. The namespace starts with :php:`TYPO3\CMS`, then the extension name in UpperCamelCase, a backslash and then the name of the subfolder of :file:`Classes/`, in which the file is located (if any). E.g. the file :file:`typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php` with the class :php:`ContentObjectRenderer` is in the namespace :php:`TYPO3\CMS\Frontend\ContentObject`. :php:`use` statements can be added to this section. Copyright Notice ================ TYPO3 is released under the terms of GNU General Public License version 2 or any later version. The copyright notice with a reference to the license text must be included at the top of every TYPO3 PHP class file. user files must have this copyright notice as well. Example:: main(); This code must appear **after** the PHP class.