seeAlso.php 665 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
<?php

/**
 * @var yii\apidoc\models\BaseDoc $object
 * @var yii\web\View $this
 */

$see = [];
foreach($object->tags as $tag) {
	/** @var $tag phpDocumentor\Reflection\DocBlock\Tag\SeeTag */
	if (get_class($tag) == 'phpDocumentor\Reflection\DocBlock\Tag\SeeTag') {
12 13 14 15 16 17
		$ref = $tag->getReference();
		if (strpos($ref, '://') === false) {
			$see[] = '[[' . $ref . ']]';
		} else {
			$see[] = $ref;
		}
18 19 20 21 22 23 24 25 26 27
	}
}
if (empty($see)) {
	return;
}
?>
<div class="SeeAlso">
<h4>See Also</h4>
<ul>
<?php foreach($see as $ref): ?>
28
	<li><?= \yii\apidoc\helpers\Markdown::process($ref, $this->context->context->getType($object->definedBy)) ?></li>
29 30 31
<?php endforeach; ?>
</ul>
</div>