context->getNavTypes(isset($type) ? $type : null, $types);
ksort($types);
$nav = [];
foreach($types as $i=>$class) {
diff --git a/extensions/apidoc/templates/bootstrap/layouts/main.php b/extensions/apidoc/templates/bootstrap/layouts/main.php
index 1dca1ddb1f..90708ba986 100644
--- a/extensions/apidoc/templates/bootstrap/layouts/main.php
+++ b/extensions/apidoc/templates/bootstrap/layouts/main.php
@@ -37,9 +37,17 @@ $this->beginPage();
'padded' => false,
'view' => $this,
]);
+ $extItems = [];
+ foreach($this->context->extensions as $ext) {
+ $extItems[] = [
+ 'label' => $ext,
+ 'url' => "./ext_{$ext}_index.html",
+ ];
+ }
$nav = [
['label' => 'Class reference', 'url' => './index.html'],
// ['label' => 'Application API', 'url' => '/site/about'],
+ ['label' => 'Extensions', 'items' => $extItems],
];
if ($this->context->guideUrl !== null) {
$nav[] = ['label' => 'Guide', 'url' => $this->context->guideUrl . 'guide_index.html'];
diff --git a/extensions/apidoc/templates/bootstrap/views/index.php b/extensions/apidoc/templates/bootstrap/views/index.php
index a8b29fc526..b971b8e9ed 100644
--- a/extensions/apidoc/templates/bootstrap/views/index.php
+++ b/extensions/apidoc/templates/bootstrap/views/index.php
@@ -8,6 +8,10 @@ use yii\apidoc\models\TraitDoc;
* @var yii\web\View $this
*/
+if (isset($readme)) {
+ echo \yii\apidoc\helpers\Markdown::process($readme);
+}
+
?>
Class Reference
From 4f68b8a4bbb68e47b1d40c54cac8cd23726a534c Mon Sep 17 00:00:00 2001
From: Carsten Brandt
Date: Wed, 29 Jan 2014 02:27:20 +0100
Subject: [PATCH 4/6] added README to main framework docs
---
extensions/apidoc/templates/bootstrap/Renderer.php | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/extensions/apidoc/templates/bootstrap/Renderer.php b/extensions/apidoc/templates/bootstrap/Renderer.php
index ef8d37b45a..73dcb27082 100644
--- a/extensions/apidoc/templates/bootstrap/Renderer.php
+++ b/extensions/apidoc/templates/bootstrap/Renderer.php
@@ -70,6 +70,13 @@ class Renderer extends \yii\apidoc\templates\html\Renderer
]);
file_put_contents($dir . "/ext_{$ext}_index.html", $indexFileContent);
}
+ $readme = @file_get_contents("https://raw.github.com/yiisoft/yii2-framework/master/README.md");
+ $indexFileContent = $this->renderWithLayout($this->indexView, [
+ 'docContext' => $context,
+ 'types' => $this->filterTypes($types, 'yii'),
+ 'readme' => $readme ?: null,
+ ]);
+ file_put_contents($dir . '/index.html', $indexFileContent);
$controller->stdout('done.' . PHP_EOL, Console::FG_GREEN);
}
From a7459c6aa2069aab04a73327df53b4b7952c30ce Mon Sep 17 00:00:00 2001
From: Carsten Brandt
Date: Wed, 29 Jan 2014 02:34:59 +0100
Subject: [PATCH 5/6] updated readmes
---
README.md | 3 +++
framework/README.md | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index d7020d9058..e6ba00d439 100644
--- a/README.md
+++ b/README.md
@@ -49,6 +49,9 @@ DOCUMENTATION
A draft of the [Definitive Guide](docs/guide/index.md) is available.
+API docs and a (quite bad) rendering of the definitive guide are currently
+available at http://stuff.cebe.cc/yii2docs/ (updated four times per hour).
+
For 1.1 users, you may refer to [Upgrading from Yii 1.1](docs/guide/upgrade-from-v1.md)
to have a general idea of what has changed in 2.0.
diff --git a/framework/README.md b/framework/README.md
index 2e397421c7..22af4a42ee 100644
--- a/framework/README.md
+++ b/framework/README.md
@@ -7,7 +7,7 @@ This is the core framework code of [Yii 2](https://github.com/yiisoft/yii2).
Installation
------------
-The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
+The preferred way to install the Yii framework is through [composer](http://getcomposer.org/download/).
Either run
From bad5a1199f6dc9f4b7ad3355bfc14a0d43ba9f84 Mon Sep 17 00:00:00 2001
From: Carsten Brandt
Date: Wed, 29 Jan 2014 02:38:54 +0100
Subject: [PATCH 6/6] apidoc: static methods do not define properties
---
extensions/apidoc/models/Context.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/extensions/apidoc/models/Context.php b/extensions/apidoc/models/Context.php
index 5a9e57f33e..168bc01973 100644
--- a/extensions/apidoc/models/Context.php
+++ b/extensions/apidoc/models/Context.php
@@ -162,6 +162,9 @@ class Context extends Component
return;
}
foreach($class->getPublicMethods() as $name => $method) {
+ if ($method->isStatic) {
+ continue;
+ }
if (!strncmp($name, 'get', 3) && $this->paramsOptional($method)) {
$propertyName = '$' . lcfirst(substr($method->name, 3));
if (isset($class->properties[$propertyName])) {