[TASK] Remove closing PHP tags
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / ViewHelpers / BaseViewHelper.php
1 <?php
2 namespace TYPO3\CMS\Fluid\ViewHelpers;
3
4 /* *
5 * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6 * *
7 * It is free software; you can redistribute it and/or modify it under *
8 * the terms of the GNU Lesser General Public License, either version 3 *
9 * of the License, or (at your option) any later version. *
10 * *
11 * The TYPO3 project - inspiring people to share! *
12 * */
13 /**
14 * View helper which creates a <base href="..."></base> tag. The Base URI
15 * is taken from the current request.
16 * In TYPO3 Flow, you should always include this ViewHelper to make the links work.
17 *
18 * = Examples =
19 *
20 * <code title="Example">
21 * <f:base />
22 * </code>
23 * <output>
24 * <base href="http://yourdomain.tld/" />
25 * (depending on your domain)
26 * </output>
27 *
28 * @api
29 */
30 class BaseViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
31
32 /**
33 * Render the "Base" tag by outputting $request->getBaseUri()
34 *
35 * Note: renders as <base></base>, because IE6 will else refuse to display
36 * the page...
37 *
38 * @return string "base"-Tag.
39 * @api
40 */
41 public function render() {
42 return '<base href="' . $this->controllerContext->getRequest()->getBaseUri() . '" />';
43 }
44 }