<?php
$title = $this->title($type);
$parseDir = $this->parseDir($type);
$fix = $type == 'xmvc' ? 'xmvc_' : '';
$allFiles = require($parseDir . "/{$fix}allFiles.php");
$allMethods = require($parseDir . "/{$fix}allMethods.php");
$methodsJson = json_encode($allMethods, JSON_UNESCAPED_UNICODE);

// @codingStandardsIgnoreStart
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charSet="utf-8" />
    <title><?= $title ?></title>
    <style>
        <?php require(__DIR__ . '/style.css'); ?>
    </style>
    <?php require(__DIR__ . '/javascript.php'); ?>
</head>

<body>
    <div class="div-main">
        <?php require(__DIR__ . '/search.tpl.php'); ?>
        <div class="div-doc">
            <h1><?= $title ?></h1>
            <h2>函数库</h2>
            <ul>
                <?php foreach ($allFiles['function']['none'] as $item) : ?>
                    <li class="class-name"><a href="<?= $this->itemUrl($item) ?>"><?= $item['relFile'] ?><span class="summary"><?= $item['summary'] ?></span></a></li>
                <?php endforeach; //函数库 
                ?>
            </ul>
            <h2>接口</h2>
            <ul>
                <?php foreach ($allFiles['interface'] as $namespace => $items) : ?>
                    <h3 class="namespace"><?= $namespace ?></h3>
                    <ul>
                        <?php foreach ($items as $item) : ?>
                            <li class="class-name"><a href="<?= $this->itemUrl($item) ?>"><?= basename(str_replace('\\', '/', $item['name'])) ?><span class="summary"><?= $item['summary'] ?></span></a></li>
                        <?php endforeach;
                        ?>
                    </ul>
                <?php endforeach; //接口 
                ?>
            </ul>
            <h2>类</h2>
            <ul>
                <?php foreach ($allFiles['class'] as $namespace => $items) : ?>
                    <h3 class="namespace"><?= $namespace ?></h3>
                    <ul>
                        <?php foreach ($items as $item) : ?>
                            <li class="class-name"><a href="<?= $this->itemUrl($item) ?>"><?= basename(str_replace('\\', '/', $item['name'])) ?><span class="summary"><?= $item['summary'] ?></span></a></li>
                        <?php endforeach;
                        ?>
                    </ul>
                <?php endforeach; //类 
                ?>
            </ul>
            <div style="height:100px"></div>
        </div><!-- div-menu -->
    </div><!-- div-main -->
</body>

</html>