propertyDetails.php 2.04 KB
Newer Older
1 2
<?php

3
use yii\apidoc\helpers\ApiMarkdown;
4 5
use yii\apidoc\models\ClassDoc;
use yii\apidoc\models\TraitDoc;
6 7
use yii\helpers\ArrayHelper;

8 9 10
/**
 * @var ClassDoc|TraitDoc $type
 * @var yii\web\View $this
11
 * @var \yii\apidoc\templates\html\ApiRenderer $renderer
12 13
 */

14 15
$renderer = $this->context;

16 17
$properties = $type->getNativeProperties();
if (empty($properties)) {
18
    return;
19 20 21
}
ArrayHelper::multisort($properties, 'name');
?>
22 23
<h2>Property Details</h2>

Carsten Brandt committed
24
<div class="property-doc">
Alexander Mohorev committed
25
<?php foreach ($properties as $property): ?>
26

27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
    <div class="detail-header h3" id="<?= $property->name.'-detail' ?>">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <?= $renderer->createSubjectLink($property, '<span class="glyphicon icon-hash"></span>', [
            'title' => 'direct link to this method',
            'class' => 'tool-link hash',
        ]) ?>

        <?php if (($sourceUrl = $renderer->getSourceUrl($property->definedBy, $property->startLine)) !== null): ?>
            <a href="<?= str_replace('/blob/', '/edit/', $sourceUrl) ?>" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="<?= $sourceUrl ?>" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        <?php endif; ?>

        <?= $property->name ?>
        <span class="detailHeaderTag small">
            <?= $property->visibility ?>
            <?php if ($property->getIsReadOnly()) echo ' <em>read-only</em> '; ?>
            <?php if ($property->getIsWriteOnly()) echo ' <em>write-only</em> '; ?>
            property
            <?php if (!empty($property->since)): ?>
                (available since version <?= $property->since ?>)
            <?php endif; ?>
        </span>
    </div>

    <div class="signature"><?php echo $renderer->renderPropertySignature($property); ?></div>

    <?= ApiMarkdown::process($property->description, $type) ?>

    <?= $this->render('seeAlso', ['object' => $property]) ?>
56 57

<?php endforeach; ?>
Carsten Brandt committed
58
</div>