Beispiel #1
0
if (($next = $section->getNextSection()) !== null) {
    $right = ' <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>';
    echo '<div class="pull-right">' . Html::a(Html::encode($next[1]) . $right, ['guide/view', 'section' => $next[0], 'version' => $guide->version, 'language' => $guide->language, 'type' => $guide->typeUrlName]) . '</div>';
}
echo '<div class="text-center"><a href="#">Go to Top <span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span></a></div>';
?>
                </div>

                <?php 
if (($editUrl = $section->editUrl) !== false) {
    ?>
                <div class="edit-icon"><i class="fa fa-github"></i></div>
                <p class="lang-en">
                    <em>Found a typo or you think this page needs improvement?<br />
                        <a href="<?php 
    echo $editUrl;
    ?>
">Edit it on github</a>!</em>
                </p>
                <?php 
}
?>
            </div>

            <?php 
echo \app\components\Comments::widget(['objectType' => 'guide', 'objectId' => $section->name . '-' . $guide->version]);
?>
        </div>
    </div>
</div>
use yii\helpers\Url;
$this->title = "API Documentation for Yii {$version}";
if (!empty($title)) {
    $this->title = "{$title} - {$this->title}";
}
?>

<div class="container api-content">
	<?php 
echo strtr($content, ['<!-- YII_VERSION_SELECTOR -->' => $this->render('_versions.php', compact('version', 'versions', 'section')), '<!-- YII_DOWNLOAD_OPTIONS -->' => '<p>You may download the API documentation for offline use: </p><ul>' . '<li>' . Html::a("yii-docs-{$version}-en.tar.bz2", ['guide/download', 'version' => $version, 'language' => 'en', 'format' => 'tar.bz2']) . '</li>' . '<li>' . Html::a("yii-docs-{$version}-en.tar.gz", ['guide/download', 'version' => $version, 'language' => 'en', 'format' => 'tar.gz']) . '</li>' . '</ul>' . '<p>This page is also available in <a href="?_format=' . urlencode('json') . '">JSON format</a>:<br>' . '<code>curl ' . Url::to(['', 'version' => $version], true) . ' -H \'Accept: application/json\'</code></p>']);
?>
</div>

<div class="container">
    <?php 
echo \app\components\Comments::widget(['objectType' => 'api', 'objectId' => $version . '-' . $section]);
?>
</div>

<?php 
$this->registerJs(<<<'JS'

$(".api-content a.toggle").on('click', function () {
    var $this = $(this);
    if ($this.hasClass('properties-hidden')) {
        $this.text($this.text().replace(/Show/,'Hide'));
        $this.parents(".summary").find(".inherited").show();
        $this.removeClass('properties-hidden');
    } else {
        $this.text($this.text().replace(/Hide/,'Show'));
        $this.parents(".summary").find(".inherited").hide();