Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Use LinkResult to generated Typolinks in Frontend
This change introduces a new immutable object "LinkResult" along with an interface, containing the base result of a generated link by TypoLink. This object contains all information needed to put together a <a> tag or return a pure URL. For the time being this new class is used to build links from the typolink link builders, and in addition should be able to be returned fully by typolink in the future. In addition, this object helps to build links needed for e.g. JSON responses to contain all information of the link to be serialized. Resolves: #94889 Releases: master Change-Id: Ic9383a1a0f0ec93ba3aa352235003268e00a2f10 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70590 Tested-by: core-ci <typo3@b13.com> Tested-by: Benni Mack <benni@typo3.org> Tested-by: Oliver Hader <oliver.hader@typo3.org> Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
- Loading branch information
1 parent
485af2b
commit 9ccd931
Showing
15 changed files
with
675 additions
and
64 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...Changelog/master/Feature-94889-AddResultOptionToTypolinkReturnLastParameter.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. include:: ../../Includes.txt | ||
|
||
====================================================================== | ||
Feature: #94889 - Add "result" option to typolink returnLast parameter | ||
====================================================================== | ||
|
||
See :issue:`94889` | ||
|
||
Description | ||
=========== | ||
|
||
This change introduces a new :php:`LinkResult` object along with an | ||
interface, containing the base result of a generated link by TypoLink. | ||
|
||
This object should contain all information needed to put together | ||
an :html:`<a>` tag or return a URL in the future. | ||
|
||
For the time being this new class is used to build links from | ||
:php:`AbstractTypolinkBuilder` implementations, and in addition | ||
should be able to be returned fully by :ts:`typolink` in the future. | ||
|
||
In addition, this object helps to build links needed | ||
for e.g. JSON responses to contain all information | ||
of the link to be serialized. | ||
|
||
Impact | ||
====== | ||
|
||
This feature allows user to handle link's data in more consistent way, also | ||
simplifies typolink handling in different outputs than HTML, like i.e. JSON | ||
|
||
.. index:: PHP-API, TypoScript, ext:frontend |
27 changes: 27 additions & 0 deletions
27
...g/master/Important-94889-LinkBuilderbuildNowReturnsArrayLinkResultInterface.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.. include:: ../../Includes.txt | ||
|
||
======================================================================================== | ||
Important: #94889 - AbstractTypoLinkBuilder::build now returns array|LinkResultInterface | ||
======================================================================================== | ||
|
||
See :issue:`94889` | ||
|
||
Description | ||
=========== | ||
|
||
The method signature of :php:`AbstractTypoLinkBuilder` has changed, as | ||
:php:`array` return type has been removed. Thus loosening the inheritance | ||
criteria for TYPO3 v11. | ||
|
||
In TYPO3 v12 :php:`AbstractTypoLinkBuilder` will have a | ||
:php:`LinkResultInterface` return type. | ||
|
||
Extensions using this class can stay compatible with two major TYPO3 LTS | ||
versions by doing the following: | ||
|
||
* Keeping an :php:`array` return type to stay compatible with | ||
TYPO3 v10 and TYPO3 v11. | ||
* Using the :php:`LinkResultInterface` return type to stay compatible with | ||
TYPO3 v11 and TYPO3 v12+. | ||
|
||
.. index:: Frontend, PHP-API, TypoScript, ext:frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.