3366248bdcf6a3ce766c480d4758822168cbc1b8
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / ViewHelpers / Info / ContentViewHelper.php
1 <?php
2 namespace TYPO3\CMS\Fluid\ViewHelpers\Info;
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 * Content Information ViewHelper
19 *
20 * Fetches an array of page metadata contained in
21 * ``$GLOBALS['TSFE']->cObj->data`` and either returns
22 * the array or assigns it to template variables in
23 * tag content if using the ``as`` argument.
24 *
25 * = Examples =
26 *
27 * <code title="With as argument">
28 * <f:info.content as="contentInfo">
29 * The content element header is {contentInfo.header}.
30 * </f:info.content>
31 * </code>
32 *
33 * <code title="Returning an array">
34 * <f:alias map="{contentInfo: '{f:info.content()}'}">
35 * The content element header is {contentInfo.header}
36 * </f:alias>
37 * </code>
38 */
39 class ContentViewHelper extends AbstractInfoViewHelper
40 {
41 /**
42 * @return array
43 */
44 protected static function getData()
45 {
46 return static::getTypoScriptFrontendController()->cObj->data;
47 }
48 }