GuideRenderer.php 1 KB
Newer Older
1 2 3 4 5 6 7 8
<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yii\apidoc\templates\bootstrap;
Carsten Brandt committed
9

10 11 12 13 14 15 16 17 18 19
use Yii;
use yii\helpers\Html;

/**
 *
 * @author Carsten Brandt <mail@cebe.cc>
 * @since 2.0
 */
class GuideRenderer extends \yii\apidoc\templates\html\GuideRenderer
{
20
    use RendererTrait;
21

22
    public $layout = '@yii/apidoc/templates/bootstrap/layouts/guide.php';
23

24 25 26 27 28 29
    /**
     * @inheritDoc
     */
    public function render($files, $targetDir)
    {
        $types = array_merge($this->apiContext->classes, $this->apiContext->interfaces, $this->apiContext->traits);
30

31 32 33 34 35 36 37 38 39
        $extTypes = [];
        foreach ($this->extensions as $k => $ext) {
            $extType = $this->filterTypes($types, $ext);
            if (empty($extType)) {
                unset($this->extensions[$k]);
                continue;
            }
            $extTypes[$ext] = $extType;
        }
40

41 42
        parent::render($files, $targetDir);
    }
Luciano Baraglia committed
43
}