Neos\Neos\ViewHelpers\Backend\ConfigurationTreeViewHelper::renderSingleLevel PHP Method

renderSingleLevel() protected method

Recursive function rendering configuration and adding it to $this->output
protected renderSingleLevel ( array $configuration, string $relativePath = null ) : void
$configuration array
$relativePath string the path up-to-now
return void
    protected function renderSingleLevel(array $configuration, $relativePath = null)
    {
        $this->output .= '<ul>';
        foreach ($configuration as $key => $value) {
            $path = $relativePath ? $relativePath . '.' . $key : $key;
            $pathEscaped = htmlspecialchars($path);
            $keyEscaped = htmlspecialchars($key);
            $typeEscaped = htmlspecialchars(gettype($value));
            if ($typeEscaped === 'array') {
                $this->output .= sprintf('<li class="folder" title="%s">', $pathEscaped);
                $this->output .= sprintf('%s&nbsp;(%s)', $keyEscaped, count($value));
                $this->renderSingleLevel($value, $path);
                $this->output .= '</li>';
            } else {
                $this->output .= '<li>';
                $this->output .= sprintf('<div class="key" title="%s">%s:</div> ', $pathEscaped, $keyEscaped);
                $this->output .= sprintf('<div class="value" title="%s">', $typeEscaped);
                switch ($typeEscaped) {
                    case 'boolean':
                        $this->output .= $value ? 'TRUE' : 'FALSE';
                        break;
                    case 'NULL':
                        $this->output .= 'NULL';
                        break;
                    default:
                        $this->output .= htmlspecialchars($value);
                }
                $this->output .= '</div>';
                $this->output .= '</li>';
            }
        }
        $this->output .= '</ul>';
    }
ConfigurationTreeViewHelper