Extension structure · Question 4 of 12

Which PHP namespace do the controller classes of the extension my_shop with the vendor Acme have?

1 answer is correct. Easy

Show answer

Answer

  • C Acme\MyShop\Controller

Explanation

Classes of an extension follow the convention Vendor\ExtensionName\Subfolder, with the extension key converted to UpperCamelCase: my_shop becomes MyShop. The file Classes/Controller/ProductController.php therefore contains the class Acme\MyShop\Controller\ProductController. This is made possible by the PSR-4 entry in composer.json, such as "Acme\\MyShop\\": "Classes/". The namespace TYPO3\CMS\… is reserved for core extensions and does not belong in your own extensions; underscores from the extension key are not carried over into the namespace.

Certifications & exams

Which exam comes next?

You can already practise for 19 exams, and 21 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications