propertySummary.php 1.32 KB
Newer Older
1 2
<?php

3
use yii\apidoc\helpers\Markdown;
4 5 6
use yii\apidoc\models\ClassDoc;
use yii\apidoc\models\TraitDoc;
/**
7
 * @var ClassDoc|TraitDoc $type
8 9 10 11
 * @var boolean $protected
 * @var yii\web\View $this
 */

Carsten Brandt committed
12
if ($protected && count($type->getProtectedProperties()) == 0 || !$protected && count($type->getPublicProperties()) == 0) {
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
	return;
} ?>

<div class="summary docProperty">
<h2><?= $protected ? 'Protected Properties' : 'Public Properties' ?></h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-property" />
	<col class="col-type" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
Carsten Brandt committed
31
<?php foreach($type->properties as $property): ?>
32 33 34 35 36 37 38 39
	<?php if($protected && $property->visibility == 'protected' || !$protected && $property->visibility != 'protected'): ?>
	<tr<?= $property->definedBy != $type->name ? ' class="inherited"' : '' ?> id="<?= $property->name ?>">
		<td><?= $this->context->subjectLink($property) ?></td>
		<td><?= $this->context->typeLink($property->types) ?></td>
		<td><?= Markdown::process($property->shortDescription, $type) ?></td>
		<td><?= $this->context->typeLink($property->definedBy) ?></td>
	</tr>
	<?php endif; ?>
40 41 42
<?php endforeach; ?>
</table>
</div>