mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-29 05:47:17 +08:00
APIDOC beautification
This commit is contained in:
@@ -11,21 +11,22 @@ foreach ($object->tags as $tag) {
|
||||
if (get_class($tag) == 'phpDocumentor\Reflection\DocBlock\Tag\SeeTag') {
|
||||
$ref = $tag->getReference();
|
||||
if (strpos($ref, '://') === false) {
|
||||
$see[] = '[[' . $ref . ']]';
|
||||
} else {
|
||||
$see[] = $ref;
|
||||
$ref = '[[' . $ref . ']]';
|
||||
}
|
||||
$see[] = rtrim(\yii\apidoc\helpers\ApiMarkdown::process($ref . ' ' . $tag->getDescription(), $object->definedBy, true), ". \r\n");
|
||||
}
|
||||
}
|
||||
if (empty($see)) {
|
||||
return;
|
||||
} elseif (count($see) == 1) {
|
||||
echo '<p>See also ' . reset($see) . '.</p>';
|
||||
} else {
|
||||
echo '<p>See also:</p><ul>';
|
||||
foreach ($see as $ref) {
|
||||
if (substr($ref, -1, 1) != '>') {
|
||||
$ref .= '.';
|
||||
}
|
||||
echo "<li>$ref</li>";
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
?>
|
||||
<div class="SeeAlso">
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<?php foreach ($see as $ref): ?>
|
||||
<li><?= \yii\apidoc\helpers\ApiMarkdown::process($ref, $object->definedBy, true) ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user