API links: More information on TYPO3 PHP classes¶
At https://api.typo3.org/ all classes and interfaces of the TYPO3 Core are listed with their public members and descriptions. The API itself also links to the source code on GitHub. You can use implicit and explicit links to these:
Explicit links to api.typo3.org¶
.. Explicit links
* :api-class:`\TYPO3\CMS\Extbase\Routing\ExtbasePluginEnhancer`
* :api-class:`In main <api-dev:\TYPO3\CMS\Extbase\Routing\ExtbasePluginEnhancer>`
* :api-class:`In 11.5 <api-11:\TYPO3\CMS\Extbase\Routing\ExtbasePluginEnhancer>`
* :api-class:`\TYPO3\CMS\Core\EventDispatcher\EventDispatcher
<api:\TYPO3\CMS\Core\EventDispatcher\EventDispatcher>`
The links then look like this:
Explicit links can use the interlink scheme to link to different TYPO3 versions. If not specified they also link to the typo3-core-preferred.
If you want to link directly to the source files on GitHub, you can use the :t3src: text role.
Implicit links to fully-qualified names¶
Implicit links have the advantage that they show more information about the class or interface in a popover while they still offer a link to the API.
.. Implicit links using the :php: text role:
* :php:`\TYPO3\CMS\Adminpanel\Controller\AjaxController`
* :php:`\TYPO3\CMS\Core\Http\Dispatcher`
* :php:`\TYPO3\CMS\Adminpanel\ModuleApi\ContentProviderInterface`
* :php:`\TYPO3\CMS\Backend\Search\LiveSearch\SearchDemand\DemandPropertyName`
* :php:`\TYPO3\CMS\Backend\Form\Behavior\OnFieldChangeTrait`
* :php:`\Psr\Log\LoggerInterface`
* :php:`\TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper`
* :php:`\MyVendor\MyExtension\FooBar`
* :php:`\Foo\Bar\Something`
.. prevent help text being displayed
`This\Is\No\Class`
The links then look like this:
\TYPO3\
CMS\ Adminpanel\ Controller\ Ajax Controller \TYPO3\
CMS\ Core\ Http\ Dispatcher \TYPO3\
CMS\ Adminpanel\ Module Api\ Content Provider Interface \TYPO3\
CMS\ Backend\ Search\ Live Search\ Search Demand\ Demand Property Name \TYPO3\
CMS\ Backend\ Form\ Behavior\ On Field Change Trait \Psr\
Log\ Logger Interface \TYPO3Fluid\
Fluid\ Core\ View Helper\ Abstract View Helper \My
Vendor\ My Extension\ Foo Bar \Foo\
Bar\ Something
This\
As you can see, only links to the namespace /TYPO3/
can be linked to the
API. We do display general information about some other namespaces that are
commonly used in TYPO3 development. Example namespaces should always start with
\My
MyVendorMyExtension` for extensions and
`MyVendorMySitepackage` for sitepackages.
Implicit links are always referring to your typo3-core-preferred as set in the guides.xml.
Links to the API with the short class name¶
Using the text role php-
you can display the short name of the class
or interface within the text. Other then that it works just like the
:php: text role.
.. Short PHP class names, still linking to the API:
* :php-short:`\TYPO3\CMS\Adminpanel\Controller\AjaxController`
* :php-short:`\TYPO3\CMS\Core\Http\Dispatcher`
* :php-short:`\TYPO3\CMS\Adminpanel\ModuleApi\ContentProviderInterface`
* :php-short:`\TYPO3\CMS\Backend\Search\LiveSearch\SearchDemand\DemandPropertyName`
* :php-short:`\TYPO3\CMS\Backend\Form\Behavior\OnFieldChangeTrait`
* :php-short:`\Psr\Log\LoggerInterface`
* :php-short:`\TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper`
* :php-short:`\MyVendor\MyExtension\FooBar`
* :php-short:`\Foo\Bar\Something`
The links then look like this: