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

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

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

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

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

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