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

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

9
/**
Carsten Brandt committed
10
 * @var ClassDoc|InterfaceDoc|TraitDoc $type
11 12 13 14
 * @var boolean $protected
 * @var yii\web\View $this
 */

Carsten Brandt committed
15
if ($protected && count($type->getProtectedMethods()) == 0 || !$protected && count($type->getPublicMethods()) == 0) {
16 17 18 19 20 21 22 23
	return;
} ?>

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

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

24
<table class="summaryTable table table-striped table-bordered table-hover">
25 26 27 28 29 30 31 32
<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>
33 34 35 36
<?php
$methods = $type->methods;
ArrayHelper::multisort($methods, 'name');
foreach($methods as $method): ?>
37 38 39
	<?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>
40
		<td><?= ApiMarkdown::process($method->shortDescription, $method->definedBy, true) ?></td>
41 42 43
		<td><?= $this->context->typeLink($method->definedBy, $type) ?></td>
	</tr>
	<?php endif; ?>
44 45 46
<?php endforeach; ?>
</table>
</div>