Completed
Push — master ( 0ecd6b...9f36b3 )
by Tim
03:56
created

JsQuoteViewHelper::initializeArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/**
3
 * Quote JS.
4
 */
5
namespace HDNET\Calendarize\ViewHelpers;
6
7
use TYPO3\CMS\Core\Utility\GeneralUtility;
8
9
/**
10
 * Quote JS.
11
 */
12
class JsQuoteViewHelper extends AbstractViewHelper
13
{
14
    /**
15
     * Init arguments
16
     */
17
    public function initializeArguments()
18
    {
19
        parent::initializeArguments();
20
        $this->registerArgument('content', 'string', 'Override content', false);
21
    }
22
23
    /**
24
     * Render the Quote JS information.
25
     *
26
     * @return string
27
     */
28
    public function render()
29
    {
30
        $content = $this->arguments['content'] === null || trim((string)$this->arguments['content']) === '' ? $this->renderChildren() : $this->arguments['content'];
31
32
        return GeneralUtility::quoteJSvalue($content);
33
    }
34
}
35