[FEATURE] Add absolute option to typolink VHs 90/55990/3
authorBenni Mack <benni@typo3.org>
Fri, 2 Mar 2018 15:36:44 +0000 (16:36 +0100)
committerBenni Mack <benni@typo3.org>
Sat, 3 Mar 2018 20:48:17 +0000 (21:48 +0100)
commit61a63389ad396bf5328fa27c152875a0ca1f01f3
tree84f9ae8795fbaf39e3e23aa8171a2d6dbd25fa4a
parent03516bcc9c2efb28f750ff2d3e7315f3addfe31c
[FEATURE] Add absolute option to typolink VHs

In order to generate absolute URLs through the
Typolink ViewHelpers of TYPO3 Fluid, a new
fluid parameter "absolute" is added to the following
ViewHelpers.

* <f:link.typolink>
* <f:uri.typolink>

As typolink() is allowing this option, the generation
of absolute URLs behaves the same way as typolink()
itself does it.

Use it like this:

The ViewHelper code:
- <f:link.typolink parameter="23">Link To My Page</f:link.typolink>
generates:
- <a href="index.php?id=23">Link to My Page</a>

The ViewHelper code:
- <f:link.typolink parameter="23" absolute="true">Link To My Page</f:link.typolink>
generates:
- <a href="https://www.mydomain.com/index.php?id=23">Link to My Page</a>

The ViewHelper code:
- <f:uri.typolink parameter="23" />
generates:
- "index.php?id=23"

The ViewHelper code:
- <f:uri.typolink parameter="23" absolute="true" />
generates:
- "https://www.mydomain.com/index.php?id=23"

Resolves: #84120
Releases: master
Change-Id: I6b6df0ebc8a7c257ab854959e5425debd0cadd5e
Reviewed-on: https://review.typo3.org/55990
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Feature-84120-AbsoluteURLsForTypolinkViewHelpers.rst [new file with mode: 0644]
typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Uri/TypolinkViewHelper.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php