index.php

Code Hygiene Score: 100

Keine Issues gefunden.

Funktionen 1

Code

<?php
function renderDocsToc(array $items, int $level = 1): string
{
    if (empty($items)) {
        return '';
    }

    $html = '<ol class="docs-toc docs-toc-level-' . $level . '">';
    foreach ($items as $item) {
        $html .= '<li>';
        $html .= '<a href="/docs' . htmlspecialchars($item['path']) . '">' . htmlspecialchars($item['title']) . '</a>';
        if (!empty($item['children'])) {
            $html .= renderDocsToc($item['children'], $level + 1);
        }
        $html .= '</li>';
    }
    $html .= '</ol>';

    return $html;
}
?>
<?php ob_start(); ?>

<h1>Dokumentation</h1>
<p>Server-Dokumentation für <strong>st</strong> (Debian 13 trixie)</p>

<?= renderDocsToc($hierarchy) ?>

<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>
← Übersicht