[FOLLOWUP][FEATURE] Update signature for newly introduced hook
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / 8.0 / Feature-54887-Post-processingOfThePreviewUrl.rst
1 ===================================================
2 Feature: #54887 - Post-processing of the previewUrl
3 ===================================================
4
5 Description
6 ===========
7
8 An additional hook has been added to the method ``BackendUtility::viewOnClick()`` to
9 post-process the preview url.
10
11 The hook is called with the following signature:
12
13 .. code-block:: php
14
15    /**
16     * @param string $previewUrl
17     * @param int $pageUid
18     * @param array $rootLine
19     * @param string $anchorSection
20     * @param string $viewScript
21     * @param string $additionalGetVars
22     * @param bool $switchFocus
23     * @return string The processed preview URL
24     */
25    function postProcess($previewUrl, $pageUid, $rootLine, $anchorSection, $viewScript, $additionalGetVars, $switchFocus)
26
27
28 Register the hook
29 -----------------
30
31 Register a hook class which implements the method with the name ``postProcess``:
32
33 .. code-block:: php
34
35    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'][] = \VENDOR\MyExt\Hooks\BackendUtilityHook::class;