248b2ec7f651a915948878b8a52e968ded6e48d8
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / Http / UrlHandlerInterface.php
1 <?php
2 namespace TYPO3\CMS\Frontend\Http;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * This interface needs to be implemented by all classes that register for the hook in:
19 * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlHandlers']
20 *
21 * It can be used to do custom URL processing during a Frontend request.
22 */
23 interface UrlHandlerInterface
24 {
25 /**
26 * Return TRUE if this hook handles the current URL.
27 * Warning! If TRUE is returned content rendering will be disabled!
28 * This method will be called in the constructor of the TypoScriptFrontendController
29 *
30 * @see \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::__construct()
31 * @see \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::initializeRedirectUrlHandlers()
32 * @return bool
33 */
34 public function canHandleCurrentUrl();
35
36 /**
37 * Custom processing of the current URL.
38 *
39 * If canHandle() has returned TRUE this method needs to take care of redirecting the user or generating custom output.
40 * This hook will be called BEFORE the user is redirected to an external URL configured in the page properties.
41 *
42 * @see \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::redirectToExternalUrl()
43 */
44 public function handle();
45 }