Carsten Brandt
11 years ago
11 changed files with 372 additions and 86 deletions
@ -1,60 +1,49 @@ |
|||||||
<?php |
<?php |
||||||
|
|
||||||
|
use yii\apidoc\components\OfflineRenderer; |
||||||
use yii\apidoc\models\ClassDoc; |
use yii\apidoc\models\ClassDoc; |
||||||
use yii\apidoc\models\InterfaceDoc; |
use yii\apidoc\models\InterfaceDoc; |
||||||
use yii\apidoc\models\TraitDoc; |
use yii\apidoc\models\TraitDoc; |
||||||
/** |
/** |
||||||
* @var ClassDoc|InterfaceDoc|TraitDoc $item |
* @var ClassDoc|InterfaceDoc|TraitDoc $item |
||||||
* @var yii\web\View $this |
* @var yii\web\View $this |
||||||
|
* @var OfflineRenderer $renderer |
||||||
*/ |
*/ |
||||||
|
$renderer = $this->context; |
||||||
|
|
||||||
?><table class="summaryTable docClass"> |
?><table class="summaryTable docClass"> |
||||||
<colgroup> |
<colgroup> |
||||||
<col class="col-name" /> |
<col class="col-name" /> |
||||||
<col class="col-value" /> |
<col class="col-value" /> |
||||||
</colgroup> |
</colgroup> |
||||||
<?php if ($item instanceof ClassDoc): ?> |
<?php if ($item instanceof ClassDoc): ?> |
||||||
<tr> |
<tr><th>Inheritance</th><td><?= $renderer->renderInheritance($item) ?></td></tr>
|
||||||
<th>Inheritance</th> |
<?php endif; ?> |
||||||
<td><?php echo $this->context->renderInheritance($item); ?></td>
|
<?php if ($item instanceof ClassDoc && !empty($item->interfaces)): ?> |
||||||
</tr> |
<tr><th>Implements</th><td><?= $renderer->renderInterfaces($item->interfaces) ?></td></tr>
|
||||||
<?php endif; ?> |
<?php endif; ?> |
||||||
<?php if(!empty($item->interfaces)): ?> |
<?php if(!($item instanceof InterfaceDoc) && !empty($item->traits)): ?> |
||||||
<tr> |
<tr><th>Uses Traits</th><td><?= $renderer->renderTraits($item->traits) ?></td></tr>
|
||||||
<th>Implements</th> |
<?php endif; ?> |
||||||
<td><?php echo $this->context->renderImplements($item); ?></td>
|
<?php if($item instanceof ClassDoc && !empty($item->subclasses)): ?> |
||||||
</tr> |
<tr><th>Subclasses</th><td><?= $renderer->renderClasses($item->subclasses) ?></td></tr>
|
||||||
<?php endif; ?> |
<?php endif; ?> |
||||||
<?php if(!($item instanceof InterfaceDoc) && !empty($item->traits)): ?> |
<?php if ($item instanceof InterfaceDoc && !empty($item->implementedBy)): ?> |
||||||
<tr> |
<tr><th>Implemented by</th><td><?= $renderer->renderClasses($item->implementedBy) ?></td></tr>
|
||||||
<th>Uses Traits</th> |
<?php endif; ?> |
||||||
<td><?php echo $this->context->renderTraitUses($item); ?></td>
|
<?php if ($item instanceof TraitDoc && !empty($item->usedBy)): ?> |
||||||
</tr> |
<tr><th>Implemented by</th><td><?= $renderer->renderClasses($item->usedBy) ?></td></tr>
|
||||||
<?php endif; ?> |
<?php endif; ?> |
||||||
<?php if($item instanceof ClassDoc && !empty($item->subclasses)): ?> |
<?php if(!empty($item->since)): ?> |
||||||
<tr> |
<tr><th>Available since version</th><td><?= $item->since ?></td></tr>
|
||||||
<th>Subclasses</th> |
<?php endif; ?> |
||||||
<td><?php echo $this->context->renderSubclasses($item); ?></td>
|
<tr> |
||||||
</tr> |
<th>Source Code</th> |
||||||
<?php endif; ?> |
<td><?php // TODO echo $this->renderSourceLink($item->sourcePath) ?></td>
|
||||||
<?php if(!empty($item->since)): ?> |
</tr> |
||||||
<tr> |
|
||||||
<th>Since</th> |
|
||||||
<td><?php echo $item->since; ?></td>
|
|
||||||
</tr> |
|
||||||
<?php endif; ?> |
|
||||||
<?php if(!empty($item->version)): ?> |
|
||||||
<tr> |
|
||||||
<th>Version</th> |
|
||||||
<td><?php echo $item->version; ?></td>
|
|
||||||
</tr> |
|
||||||
<?php endif; ?> |
|
||||||
<tr> |
|
||||||
<th>Source Code</th> |
|
||||||
<!-- <td>--><?php //echo $this->renderSourceLink($item->sourcePath); ?><!--</td>-->
|
|
||||||
</tr> |
|
||||||
</table> |
</table> |
||||||
|
|
||||||
<div id="classDescription"> |
<div id="classDescription"> |
||||||
<?php echo $item->description; ?> |
<strong><?= $item->shortDescription ?></strong>
|
||||||
|
<p><?= nl2br($item->description) ?></p>
|
||||||
</div> |
</div> |
@ -0,0 +1,34 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use yii\apidoc\models\ClassDoc; |
||||||
|
/** |
||||||
|
* @var ClassDoc $item |
||||||
|
* @var yii\web\View $this |
||||||
|
*/ |
||||||
|
|
||||||
|
if (empty($item->constants)) { |
||||||
|
return; |
||||||
|
} ?> |
||||||
|
<div class="summary docConst"> |
||||||
|
<h2>Constants</h2> |
||||||
|
|
||||||
|
<p><a href="#" class="toggle">Hide inherited constants</a></p> |
||||||
|
|
||||||
|
<table class="summaryTable"> |
||||||
|
<colgroup> |
||||||
|
<col class="col-const" /> |
||||||
|
<col class="col-description" /> |
||||||
|
<col class="col-defined" /> |
||||||
|
</colgroup> |
||||||
|
<tr> |
||||||
|
<th>Constant</th><th>Description</th><th>Defined By</th> |
||||||
|
</tr> |
||||||
|
<?php foreach($item->constants as $constant): ?> |
||||||
|
<tr<?= $constant->definedBy != $item->name ? ' class="inherited"' : '' ?> id="<?= $constant->name ?>">
|
||||||
|
<td><?= $this->context->subjectLink($constant) ?></td>
|
||||||
|
<td><?= $constant->shortDescription ?></td>
|
||||||
|
<td><?= $this->context->typeLink($constant->definedBy) ?></td>
|
||||||
|
</tr> |
||||||
|
<?php endforeach; ?> |
||||||
|
</table> |
||||||
|
</div> |
@ -0,0 +1,34 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use yii\apidoc\models\ClassDoc; |
||||||
|
/** |
||||||
|
* @var ClassDoc $item |
||||||
|
* @var yii\web\View $this |
||||||
|
*/ |
||||||
|
|
||||||
|
if (empty($item->events)) { |
||||||
|
return; |
||||||
|
} ?> |
||||||
|
<div class="summary docEvent"> |
||||||
|
<h2>Events</h2> |
||||||
|
|
||||||
|
<p><a href="#" class="toggle">Hide inherited events</a></p> |
||||||
|
|
||||||
|
<table class="summaryTable"> |
||||||
|
<colgroup> |
||||||
|
<col class="col-event" /> |
||||||
|
<col class="col-description" /> |
||||||
|
<col class="col-defined" /> |
||||||
|
</colgroup> |
||||||
|
<tr> |
||||||
|
<th>Event</th><th>Description</th><th>Defined By</th> |
||||||
|
</tr> |
||||||
|
<?php foreach($item->events as $event): ?> |
||||||
|
<tr<?= $event->definedBy != $item->name ? ' class="inherited"' : '' ?> id="<?= $event->name ?>">
|
||||||
|
<td><?= $this->context->subjectLink($event) ?></td>
|
||||||
|
<td><?= $event->shortDescription ?></td>
|
||||||
|
<td><?= $this->context->typeLink($event->definedBy) ?></td>
|
||||||
|
</tr> |
||||||
|
<?php endforeach; ?> |
||||||
|
</table> |
||||||
|
</div> |
@ -0,0 +1,40 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use yii\apidoc\models\ClassDoc; |
||||||
|
use yii\apidoc\models\InterfaceDoc; |
||||||
|
use yii\apidoc\models\TraitDoc; |
||||||
|
/** |
||||||
|
* @var ClassDoc|InterfaceDoc|TraitDoc $item |
||||||
|
* @var boolean $protected |
||||||
|
* @var yii\web\View $this |
||||||
|
*/ |
||||||
|
|
||||||
|
if ($protected && count($item->getProtectedMethods()) == 0 || !$protected && count($item->getPublicMethods()) == 0) { |
||||||
|
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> |
||||||
|
<?php foreach($item->methods as $method): ?> |
||||||
|
<?php if($protected && $method->visibility == 'protected' || !$protected && $method->visibility != 'protected'): ?> |
||||||
|
<tr<?= $method->definedBy != $item->name ? ' class="inherited"' : '' ?> id="<?= $method->name ?>">
|
||||||
|
<td><?= $this->context->subjectLink($method, $method->name.'()') ?></td>
|
||||||
|
<td><?= $method->shortDescription ?></td>
|
||||||
|
<td><?= $this->context->typeLink($method->definedBy) ?></td>
|
||||||
|
</tr> |
||||||
|
<?php endif; ?> |
||||||
|
<?php endforeach; ?> |
||||||
|
</table> |
||||||
|
</div> |
@ -0,0 +1,42 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use yii\apidoc\models\ClassDoc; |
||||||
|
use yii\apidoc\models\InterfaceDoc; |
||||||
|
use yii\apidoc\models\TraitDoc; |
||||||
|
/** |
||||||
|
* @var ClassDoc|InterfaceDoc|TraitDoc $item |
||||||
|
* @var boolean $protected |
||||||
|
* @var yii\web\View $this |
||||||
|
*/ |
||||||
|
|
||||||
|
if ($protected && count($item->getProtectedProperties()) == 0 || !$protected && count($item->getPublicProperties()) == 0) { |
||||||
|
return; |
||||||
|
} ?> |
||||||
|
|
||||||
|
<div class="summary docProperty"> |
||||||
|
<h2><?= $protected ? 'Protected Properties' : 'Public Properties' ?></h2>
|
||||||
|
|
||||||
|
<p><a href="#" class="toggle">Hide inherited properties</a></p> |
||||||
|
|
||||||
|
<table class="summaryTable"> |
||||||
|
<colgroup> |
||||||
|
<col class="col-property" /> |
||||||
|
<col class="col-type" /> |
||||||
|
<col class="col-description" /> |
||||||
|
<col class="col-defined" /> |
||||||
|
</colgroup> |
||||||
|
<tr> |
||||||
|
<th>Property</th><th>Type</th><th>Description</th><th>Defined By</th> |
||||||
|
</tr> |
||||||
|
<?php foreach($item->properties as $property): ?> |
||||||
|
<?php if($protected && $property->visibility == 'protected' || !$protected && $property->visibility != 'protected'): ?> |
||||||
|
<tr<?= $property->definedBy != $item->name ? ' class="inherited"' : '' ?> id="<?= $property->name ?>">
|
||||||
|
<td><?php echo $this->context->subjectLink($property); ?></td>
|
||||||
|
<td><?php echo $this->context->typeLink($property->types); ?></td>
|
||||||
|
<td><?php echo $property->shortDescription; ?></td>
|
||||||
|
<td><?php echo $this->context->typeLink($property->definedBy); ?></td>
|
||||||
|
</tr> |
||||||
|
<?php endif; ?> |
||||||
|
<?php endforeach; ?> |
||||||
|
</table> |
||||||
|
</div> |
Loading…
Reference in new issue