guide.php 1.3 KB
Newer Older
1
<?php
2

3 4 5 6
use yii\apidoc\templates\bootstrap\SideNavWidget;

/**
 * @var yii\web\View $this
7
 * @var string $content
8
 * @var array $chapters
9 10 11 12 13
 */

$this->beginContent('@yii/apidoc/templates/bootstrap/layouts/main.php'); ?>

<div class="row">
14 15 16
    <div class="col-md-2">
        <?php
        $nav = [];
17 18 19 20 21 22 23
        foreach ($chapters as $chapter) {
            $items = [];
            foreach($chapter['content'] as $chContent) {
                $items[] = [
                    'label' => $chContent['headline'],
                    'url' => $this->context->generateGuideUrl($chContent['file']),
                    'active' => isset($currentFile) && ($chContent['file'] == basename($currentFile)),
24 25
                ];
            }
26
            $nav[] = [
27 28 29
                'label' => $chapter['headline'],
//                'url' => $this->context->generateGuideUrl($file),
                'items' => $items,
30 31 32 33 34 35 36 37 38 39
            ];
        } ?>
        <?= SideNavWidget::widget([
            'id' => 'navigation',
            'items' => $nav,
            'view' => $this,
        ]) ?>
    </div>
    <div class="col-md-9 guide-content" role="main">
        <?= $content ?>
40
        <div class="toplink"><a href="#" class="h1" title="go to top"><span class="glyphicon glyphicon-arrow-up"></a></div>
41
    </div>
42 43
</div>

44
<?php $this->endContent(); ?>