Frontend link builder
Deprecated since version 14.0
The
build method in
\TYPO3\
has been deprecated in favor of the new
\TYPO3\.
See also Deprecation: #106405 - AbstractTypolinkBuilder->build.
A link builder is a class that implements
\TYPO3\ and that is called when
a link is rendered in the frontend.
There are link builders for every type of link. Which link to call is determined by the respective class configured in global configuration, see FE - frontend configuration.
Register a custom link builder in your extension's ext_localconf.php:
<?php
declare(strict_types=1);
use MyVendor\MyExtension\LinkHandler\MyLinkBuilder;
defined('TYPO3') or die();
$GLOBALS['TYPO3_CONF_VARS']['FE']['typolinkBuilder']['mylinkkey'] =
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
Typolink. It is called with
with the parameter array provided by the
Core link handler.
If the link can be rendered,
it returns a new
\TYPO3\ object. 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\.