constSummary.php 1.14 KB
Newer Older
1 2
<?php

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

7
/**
Carsten Brandt committed
8
 * @var ClassDoc $type
9 10 11
 * @var yii\web\View $this
 */

Carsten Brandt committed
12
if (empty($type->constants)) {
13
	return;
14 15 16 17
}
$constants = $type->constants;
ArrayHelper::multisort($constants, 'name');
?>
18 19 20 21 22
<div class="summary docConst">
<h2>Constants</h2>

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

23
<table class="summaryTable table table-striped table-bordered table-hover">
24 25 26 27 28 29
<colgroup>
	<col class="col-const" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
30
  <th>Constant</th><th>Value</th><th>Description</th><th>Defined By</th>
31
</tr>
32
<?php foreach($constants as $constant): ?>
33
	<tr<?= $constant->definedBy != $type->name ? ' class="inherited"' : '' ?> id="<?= $constant->name ?>">
34
	  <td><?= $constant->name ?><a name="<?= $constant->name ?>-detail"></a></td>
35
	  <td><?= $constant->value ?></td>
36
	  <td><?= APiMarkdown::process($constant->shortDescription . "\n" . $constant->description, $constant->definedBy, true) ?></td>
37 38
	  <td><?= $this->context->typeLink($constant->definedBy) ?></td>
	</tr>
39 40 41
<?php endforeach; ?>
</table>
</div>