diff --git a/extensions/yii/apidoc/components/OfflineRenderer.php b/extensions/yii/apidoc/components/OfflineRenderer.php
index a3660f7..3f2df90 100644
--- a/extensions/yii/apidoc/components/OfflineRenderer.php
+++ b/extensions/yii/apidoc/components/OfflineRenderer.php
@@ -28,7 +28,7 @@ class OfflineRenderer extends BaseRenderer implements ViewContextInterface
public $targetDir;
public $layout = '@yii/apidoc/views/layouts/offline.php';
- public $itemView = '@yii/apidoc/views/class.php';
+ public $typeView = '@yii/apidoc/views/type.php';
public $indexView = '@yii/apidoc/views/index.php';
public $pageTitle = 'Yii Framework 2.0 API Documentation';
@@ -50,24 +50,24 @@ class OfflineRenderer extends BaseRenderer implements ViewContextInterface
mkdir($dir);
}
- $items = array_merge($context->classes, $context->interfaces, $context->traits);
- $itemCount = count($items) + 1;
- Console::startProgress(0, $itemCount, 'Rendering files: ', false);
+ $types = array_merge($context->classes, $context->interfaces, $context->traits);
+ $typeCount = count($types) + 1;
+ Console::startProgress(0, $typeCount, 'Rendering files: ', false);
$done = 0;
- foreach($items as $item) {
- $fileContent = $this->renderWithLayout($this->itemView, [
- 'item' => $item,
+ foreach($types as $type) {
+ $fileContent = $this->renderWithLayout($this->typeView, [
+ 'type' => $type,
'docContext' => $context,
]);
- file_put_contents($dir . '/' . $this->generateFileName($item->name), $fileContent);
- Console::updateProgress(++$done, $itemCount);
+ file_put_contents($dir . '/' . $this->generateFileName($type->name), $fileContent);
+ Console::updateProgress(++$done, $typeCount);
}
$indexFileContent = $this->renderWithLayout($this->indexView, [
'docContext' => $context,
- 'items' => $items,
+ 'types' => $types,
]);
file_put_contents($dir . '/index.html', $indexFileContent);
- Console::updateProgress(++$done, $itemCount);
+ Console::updateProgress(++$done, $typeCount);
Console::endProgress(true);
$controller->stdout('done.' . PHP_EOL, Console::FG_GREEN);
@@ -209,9 +209,9 @@ class OfflineRenderer extends BaseRenderer implements ViewContextInterface
}
- public function generateFileName($itemName)
+ public function generateFileName($typeName)
{
- return strtolower(str_replace('\\', '_', $itemName)) . '.html';
+ return strtolower(str_replace('\\', '_', $typeName)) . '.html';
}
/**
diff --git a/extensions/yii/apidoc/views/class.php b/extensions/yii/apidoc/views/class.php
deleted file mode 100644
index f3db8cf..0000000
--- a/extensions/yii/apidoc/views/class.php
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
isFinal) {
- echo 'Final ';
- }
- if ($item->isAbstract) {
- echo 'Abstract ';
- }
- echo 'Class ';
- }
- echo $item->name;
-?>
-
-
-= $this->render('classSummary', ['item' => $item]) ?>
-
-
-= $this->render('propertySummary', ['item' => $item,'protected' => false]) ?>
-= $this->render('propertySummary', ['item' => $item,'protected' => true]) ?>
-
-
-= $this->render('methodSummary', ['item' => $item, 'protected' => false]) ?>
-= $this->render('methodSummary', ['item' => $item, 'protected' => true]) ?>
-
-
-= $this->render('eventSummary', ['item' => $item]) ?>
-
-
-= $this->render('constSummary', ['item' => $item]) ?>
-
-renderPartial('propertyDetails',array('class'=>$item)); ?>
-renderPartial('methodDetails',array('class'=>$item)); ?>
diff --git a/extensions/yii/apidoc/views/classSummary.php b/extensions/yii/apidoc/views/classSummary.php
deleted file mode 100644
index 2de3811..0000000
--- a/extensions/yii/apidoc/views/classSummary.php
+++ /dev/null
@@ -1,49 +0,0 @@
-context;
-
-?>
-
-
-
-
-
- Inheritance | = $renderer->renderInheritance($item) ?> |
-
- interfaces)): ?>
- Implements | = $renderer->renderInterfaces($item->interfaces) ?> |
-
- traits)): ?>
- Uses Traits | = $renderer->renderTraits($item->traits) ?> |
-
- subclasses)): ?>
- Subclasses | = $renderer->renderClasses($item->subclasses) ?> |
-
- implementedBy)): ?>
- Implemented by | = $renderer->renderClasses($item->implementedBy) ?> |
-
- usedBy)): ?>
- Implemented by | = $renderer->renderClasses($item->usedBy) ?> |
-
- since)): ?>
- Available since version | = $item->since ?> |
-
-
- Source Code |
- renderSourceLink($item->sourcePath) ?> |
-
-
-
-
-
= $item->shortDescription ?>
-
= nl2br($item->description) ?>
-
\ No newline at end of file
diff --git a/extensions/yii/apidoc/views/constSummary.php b/extensions/yii/apidoc/views/constSummary.php
index 7ed2d1a..abac8c4 100644
--- a/extensions/yii/apidoc/views/constSummary.php
+++ b/extensions/yii/apidoc/views/constSummary.php
@@ -2,11 +2,11 @@
use yii\apidoc\models\ClassDoc;
/**
- * @var ClassDoc $item
+ * @var ClassDoc $type
* @var yii\web\View $this
*/
-if (empty($item->constants)) {
+if (empty($type->constants)) {
return;
} ?>
@@ -23,8 +23,8 @@ if (empty($item->constants)) {
Constant | Description | Defined By |
-constants as $constant): ?>
-
definedBy != $item->name ? ' class="inherited"' : '' ?> id="= $constant->name ?>">
+constants as $constant): ?>
+
definedBy != $type->name ? ' class="inherited"' : '' ?> id="= $constant->name ?>">
= $this->context->subjectLink($constant) ?> |
= $constant->shortDescription ?> |
= $this->context->typeLink($constant->definedBy) ?> |
diff --git a/extensions/yii/apidoc/views/eventSummary.php b/extensions/yii/apidoc/views/eventSummary.php
index 72ebafa..9493846 100644
--- a/extensions/yii/apidoc/views/eventSummary.php
+++ b/extensions/yii/apidoc/views/eventSummary.php
@@ -2,11 +2,11 @@
use yii\apidoc\models\ClassDoc;
/**
- * @var ClassDoc $item
+ * @var ClassDoc $type
* @var yii\web\View $this
*/
-if (empty($item->events)) {
+if (empty($type->events)) {
return;
} ?>
@@ -23,8 +23,8 @@ if (empty($item->events)) {
Event | Description | Defined By |
-events as $event): ?>
-
definedBy != $item->name ? ' class="inherited"' : '' ?> id="= $event->name ?>">
+events as $event): ?>
+
definedBy != $type->name ? ' class="inherited"' : '' ?> id="= $event->name ?>">
= $this->context->subjectLink($event) ?> |
= $event->shortDescription ?> |
= $this->context->typeLink($event->definedBy) ?> |
diff --git a/extensions/yii/apidoc/views/index.php b/extensions/yii/apidoc/views/index.php
index bdaa548..310e9af 100644
--- a/extensions/yii/apidoc/views/index.php
+++ b/extensions/yii/apidoc/views/index.php
@@ -4,7 +4,7 @@ use yii\apidoc\models\ClassDoc;
use yii\apidoc\models\InterfaceDoc;
use yii\apidoc\models\TraitDoc;
/**
- * @var ClassDoc[]|InterfaceDoc[]|TraitDoc[] $items
+ * @var ClassDoc[]|InterfaceDoc[]|TraitDoc[] $types
* @var yii\web\View $this
*/
@@ -20,8 +20,8 @@ use yii\apidoc\models\TraitDoc;
Class | Description |
$class): ?>
+ksort($types);
+foreach($types as $i=>$class): ?>
context->typeLink($class, $class->name); ?> |
shortDescription; ?> |
diff --git a/extensions/yii/apidoc/views/methodSummary.php b/extensions/yii/apidoc/views/methodSummary.php
index 81a2c41..19f3e61 100644
--- a/extensions/yii/apidoc/views/methodSummary.php
+++ b/extensions/yii/apidoc/views/methodSummary.php
@@ -4,12 +4,12 @@ use yii\apidoc\models\ClassDoc;
use yii\apidoc\models\InterfaceDoc;
use yii\apidoc\models\TraitDoc;
/**
- * @var ClassDoc|InterfaceDoc|TraitDoc $item
+ * @var ClassDoc|InterfaceDoc|TraitDoc $type
* @var boolean $protected
* @var yii\web\View $this
*/
-if ($protected && count($item->getProtectedMethods()) == 0 || !$protected && count($item->getPublicMethods()) == 0) {
+if ($protected && count($type->getProtectedMethods()) == 0 || !$protected && count($type->getPublicMethods()) == 0) {
return;
} ?>
@@ -27,9 +27,9 @@ if ($protected && count($item->getProtectedMethods()) == 0 || !$protected && cou
Method | Description | Defined By |
-methods as $method): ?>
+methods as $method): ?>
visibility == 'protected' || !$protected && $method->visibility != 'protected'): ?>
-
definedBy != $item->name ? ' class="inherited"' : '' ?> id="= $method->name ?>">
+
definedBy != $type->name ? ' class="inherited"' : '' ?> id="= $method->name ?>">
= $this->context->subjectLink($method, $method->name.'()') ?> |
= $method->shortDescription ?> |
= $this->context->typeLink($method->definedBy) ?> |
diff --git a/extensions/yii/apidoc/views/propertySummary.php b/extensions/yii/apidoc/views/propertySummary.php
index be6af10..4b1e935 100644
--- a/extensions/yii/apidoc/views/propertySummary.php
+++ b/extensions/yii/apidoc/views/propertySummary.php
@@ -4,12 +4,12 @@ use yii\apidoc\models\ClassDoc;
use yii\apidoc\models\InterfaceDoc;
use yii\apidoc\models\TraitDoc;
/**
- * @var ClassDoc|InterfaceDoc|TraitDoc $item
+ * @var ClassDoc|InterfaceDoc|TraitDoc $type
* @var boolean $protected
* @var yii\web\View $this
*/
-if ($protected && count($item->getProtectedProperties()) == 0 || !$protected && count($item->getPublicProperties()) == 0) {
+if ($protected && count($type->getProtectedProperties()) == 0 || !$protected && count($type->getPublicProperties()) == 0) {
return;
} ?>
@@ -28,9 +28,9 @@ if ($protected && count($item->getProtectedProperties()) == 0 || !$protected &&
Property | Type | Description | Defined By |
-properties as $property): ?>
+properties as $property): ?>
visibility == 'protected' || !$protected && $property->visibility != 'protected'): ?>
-
definedBy != $item->name ? ' class="inherited"' : '' ?> id="= $property->name ?>">
+
definedBy != $type->name ? ' class="inherited"' : '' ?> id="= $property->name ?>">
context->subjectLink($property); ?> |
context->typeLink($property->types); ?> |
shortDescription; ?> |
diff --git a/extensions/yii/apidoc/views/type.php b/extensions/yii/apidoc/views/type.php
new file mode 100644
index 0000000..2c20197
--- /dev/null
+++ b/extensions/yii/apidoc/views/type.php
@@ -0,0 +1,98 @@
+context;
+?>
+isFinal) {
+ echo 'Final ';
+ }
+ if ($type->isAbstract) {
+ echo 'Abstract ';
+ }
+ echo 'Class ';
+ }
+ echo $type->name;
+?>
+
+
+
+
+
+
+
+
+ Inheritance | = $renderer->renderInheritance($type) ?> |
+
+ interfaces)): ?>
+ Implements | = $renderer->renderInterfaces($type->interfaces) ?> |
+
+ traits)): ?>
+ Uses Traits | = $renderer->renderTraits($type->traits) ?> |
+
+ subclasses)): ?>
+ Subclasses | = $renderer->renderClasses($type->subclasses) ?> |
+
+ implementedBy)): ?>
+ Implemented by | = $renderer->renderClasses($type->implementedBy) ?> |
+
+ usedBy)): ?>
+ Implemented by | = $renderer->renderClasses($type->usedBy) ?> |
+
+ since)): ?>
+ Available since version | = $type->since ?> |
+
+
+ Source Code |
+ renderSourceLink($type->sourcePath) ?> |
+
+
+
+
+
= $type->shortDescription ?>
+
= nl2br($type->description) ?>
+
+
+
+= $this->render('propertySummary', ['type' => $type,'protected' => false]) ?>
+= $this->render('propertySummary', ['type' => $type,'protected' => true]) ?>
+
+
+= $this->render('methodSummary', ['type' => $type, 'protected' => false]) ?>
+= $this->render('methodSummary', ['type' => $type, 'protected' => true]) ?>
+
+
+= $this->render('eventSummary', ['type' => $type]) ?>
+
+
+= $this->render('constSummary', ['type' => $type]) ?>
+
+renderPartial('propertyDetails',array('type'=>$type)); ?>
+renderPartial('methodDetails',array('type'=>$type)); ?>