methodSummary.php 1.26 KB
Newer Older
1 2
<?php

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

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

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

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

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