3.1.4 Registration in PHP
In order to tell Flux that you have added a Provider Extension and that your Provider Extension contains this and that type of template files (e.g. Page and Content templates) you use a small piece of PHP code:
// ext_localconf.php \FluidTYPO3\Flux\Core::registerProviderExtensionKey('myextensionkey', 'Content'); \FluidTYPO3\Flux\Core::registerProviderExtensionKey('myextensionkey', 'Page');
This instructs Flux that a) a new Provider Extension now exists and b) it contains templates for the
Content controller type and c) it also contains templates for the
Page controller type. It is important to notice that Flux itself does not render these templates (Flux does, however, read the configuration stored within them!) - Flux's role in this case is simply to provide a shared API which can keep track of which Provider Extension contains which template types.
If your Provider Extension contains Controller classes
When your Provider Extensions contain controller classes for any of the controller types you register (
PageController etc.) there are a few things you must also be aware of. These are:
- Flux will detect this controller by checking if the expected class name exists. This means you do not need to configure access to the controller in any way - Flux will handle this for you.
- If your Provider Extension uses PHP namespaces (which it should) then your
myextensionkeyparameter in the registration examples above, should instead of the lowercase extension key contain a combined vendor and extension name, á la
MyVendorName.Myextensionkey. This format will make Flux always look for the namespace based class name - any other format makes Flux look for the old-school
Tx_prefixed class name.
- In order for some features to work, as well as in order for fallbacks to be possible, your controller class names should have aliases configured in the
EXT:myextensionkey/Migrations/Code/ClassAliasMap.phpfile (see any TYPO3 core extension for reference). It is intentionally not specified here which features depend on this alias as this detail changes whenever the minimum required TYPO3 core version changes. Rule of thumb is: the higher your TYPO3 core version is, the less likely it is you will need the alias map.