Completed
Pull Request — master (#251)
by Claus
02:58
created

HideViewHelper::renderStatic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
namespace TYPO3Fluid\Fluid\ViewHelpers\Format;
3
4
/*
5
 * This file belongs to the package "TYPO3 Fluid".
6
 * See LICENSE.txt that was shipped with this package.
7
 */
8
9
use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler;
10
use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode;
11
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
12
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
13
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
14
15
/**
16
 * Hides, but still executes, the tag content.
17
 *
18
 * Useful when you have Fluid code that you want to execute
19
 * but do not wish to output. For example, around variable
20
 * assignments to remove resulting whitespace.
21
 *
22
 * = Examples =
23
 *
24
 * <code title="Hiding output">
25
 * <f:format.hide>
26
 *      <!-- Everything inside the tag is executed but not output -->
27
 *      <!--
28
 *          Which menas that among other things, you can use HTML
29
 *          comments which will not be output but are visible to
30
 *          developers reading the template source code.
31
 *      -->
32
 *      {string -> f:format.htmlspecialchars() -> f:variable(name: 'newvariable')}
33
 * </f:format.hide>
34
 * </code>
35
 * <output>
36
 * (Content of {string} without any conversion/escaping)
37
 * </output>
38
 *
39
 * @api
40
 */
41
class HideViewHelper extends AbstractViewHelper
42
{
43
    use CompileWithRenderStatic;
44
45
    /**
46
     * @param array $arguments
47
     * @param \Closure $renderChildrenClosure
48
     * @param RenderingContextInterface $renderingContext
49
     * @return mixed
50
     */
51
    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
52
    {
53
        $renderChildrenClosure();
54
    }
55
56
}
57