Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
Frontend link builder
A link builder, a class extending the abstract class
\TYPO3\
, is called whenever
a link is rendered in the frontend.
There are specific link builders for each type of link. Which link to call is determined by the class configured in global configuration, see typolinkBuilder.
You can register a custom link builder in your extension's ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['FE']['typolinkBuilder']['mylinkkey'] =
\MyVendor\MyExtension\LinkHandler\MyLinkBuilder::class;
The link builders provided by the Core can be found in namespace
\TYPO3\
. It is possible to also create a
custom link builder.
The main method of a link builder is the function
Abstract
. It is called with
with the parameter array provided by the
Core link handler.
If the link can be rendered, it returns a new link result. The actual rendering of the link depends on the context the link is rendered in (for example HTML or JSON).
If the link cannot be built it should throw a
\TYPO3\
.