propertyDetails.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. use yii\apidoc\helpers\ApiMarkdown;
  3. use yii\apidoc\models\ClassDoc;
  4. use yii\apidoc\models\TraitDoc;
  5. use yii\helpers\ArrayHelper;
  6. /* @var $type ClassDoc|TraitDoc */
  7. /* @var $this yii\web\View */
  8. /* @var $renderer \yii\apidoc\templates\html\ApiRenderer */
  9. $renderer = $this->context;
  10. $properties = $type->getNativeProperties();
  11. if (empty($properties)) {
  12. return;
  13. }
  14. ArrayHelper::multisort($properties, 'name');
  15. ?>
  16. <h2>Property Details</h2>
  17. <div class="property-doc">
  18. <?php foreach ($properties as $property): ?>
  19. <div class="detail-header h3" id="<?= $property->name.'-detail' ?>">
  20. <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
  21. <?= $renderer->createSubjectLink($property, '<span class="glyphicon icon-hash"></span>', [
  22. 'title' => 'direct link to this method',
  23. 'class' => 'tool-link hash',
  24. ]) ?>
  25. <?php if (($sourceUrl = $renderer->getSourceUrl($property->definedBy, $property->startLine)) !== null): ?>
  26. <a href="<?= str_replace('/blob/', '/edit/', $sourceUrl) ?>" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
  27. <a href="<?= $sourceUrl ?>" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
  28. <?php endif; ?>
  29. <?= $property->name ?>
  30. <span class="detail-header-tag small">
  31. <?= $property->visibility ?>
  32. <?= $property->isStatic ? 'static' : '' ?>
  33. <?php if ($property->getIsReadOnly()) echo ' <em>read-only</em> '; ?>
  34. <?php if ($property->getIsWriteOnly()) echo ' <em>write-only</em> '; ?>
  35. property
  36. <?php if (!empty($property->since)): ?>
  37. (available since version <?= $property->since ?>)
  38. <?php endif; ?>
  39. </span>
  40. </div>
  41. <?php if (!empty($property->deprecatedSince) || !empty($property->deprecatedReason)): ?>
  42. <div class="doc-description deprecated">
  43. <strong>Deprecated <?php
  44. if (!empty($property->deprecatedSince)) { echo 'since version ' . $property->deprecatedSince . ': '; }
  45. if (!empty($property->deprecatedReason)) { echo ApiMarkdown::process($property->deprecatedReason, $type, true); }
  46. ?></strong>
  47. </div>
  48. <?php endif; ?>
  49. <div class="doc-description">
  50. <?= ApiMarkdown::process($property->description, $type) ?>
  51. <?= $this->render('seeAlso', ['object' => $property]) ?>
  52. </div>
  53. <div class="signature"><?php echo $renderer->renderPropertySignature($property, $type); ?></div>
  54. <?php endforeach; ?>
  55. </div>