diff --git a/extensions/apidoc/models/FunctionDoc.php b/extensions/apidoc/models/FunctionDoc.php
index 2befe0a198..5e6e945fbd 100644
--- a/extensions/apidoc/models/FunctionDoc.php
+++ b/extensions/apidoc/models/FunctionDoc.php
@@ -73,7 +73,7 @@ class FunctionDoc extends BaseDoc
} elseif ($tag instanceof ReturnTag) {
$this->returnType = $tag->getType();
$this->returnTypes = $tag->getTypes();
- $this->return = $tag->getDescription();
+ $this->return = ucfirst($tag->getDescription());
unset($this->tags[$i]);
}
}
diff --git a/extensions/apidoc/renderers/BaseRenderer.php b/extensions/apidoc/renderers/BaseRenderer.php
index ce0d4e0755..67e1acf8c0 100644
--- a/extensions/apidoc/renderers/BaseRenderer.php
+++ b/extensions/apidoc/renderers/BaseRenderer.php
@@ -57,9 +57,10 @@ abstract class BaseRenderer extends Component
* @param ClassDoc|InterfaceDoc|TraitDoc|ClassDoc[]|InterfaceDoc[]|TraitDoc[] $types
* @param string $title a title to be used for the link TODO check whether [[yii\...|Class]] is supported
* @param BaseDoc $context
+ * @param array $options additional HTML attributes for the link.
* @return string
*/
- public function createTypeLink($types, $context = null, $title = null)
+ public function createTypeLink($types, $context = null, $title = null, $options = [])
{
if (!is_array($types)) {
$types = [$types];
@@ -103,9 +104,9 @@ abstract class BaseRenderer extends Component
// check if it is PHP internal class
if (((class_exists($type, false) || interface_exists($type, false) || trait_exists($type, false)) &&
($reflection = new \ReflectionClass($type)) && $reflection->isInternal())) {
- $links[] = $this->generateLink($linkText, 'http://www.php.net/class.' . strtolower(ltrim($type, '\\'))) . $postfix;
+ $links[] = $this->generateLink($linkText, 'http://www.php.net/class.' . strtolower(ltrim($type, '\\')), $options) . $postfix;
} elseif (in_array($type, $phpTypes)) {
- $links[] = $this->generateLink($linkText, 'http://www.php.net/language.types.' . strtolower(ltrim($type, '\\'))) . $postfix;
+ $links[] = $this->generateLink($linkText, 'http://www.php.net/language.types.' . strtolower(ltrim($type, '\\')), $options) . $postfix;
} else {
$links[] = $type;
}
@@ -114,10 +115,10 @@ abstract class BaseRenderer extends Component
if ($title !== null) {
$linkText = $title;
}
- $links[] = $this->generateLink($linkText, $this->generateApiUrl($type->name)) . $postfix;
+ $links[] = $this->generateLink($linkText, $this->generateApiUrl($type->name), $options) . $postfix;
}
}
- return implode(' | ', $links);
+ return implode('|', $links);
}
@@ -125,9 +126,10 @@ abstract class BaseRenderer extends Component
* creates a link to a subject
* @param PropertyDoc|MethodDoc|ConstDoc|EventDoc $subject
* @param string $title
+ * @param array $options additional HTML attributes for the link.
* @return string
*/
- public function createSubjectLink($subject, $title = null)
+ public function createSubjectLink($subject, $title = null, $options = [])
{
if ($title === null) {
if ($subject instanceof MethodDoc) {
@@ -146,7 +148,7 @@ abstract class BaseRenderer extends Component
$link .= '#' . $subject->name;
}
$link .= '-detail';
- return Html::a($title, null, ['href' => $link]);
+ return $this->generateLink($title, $link, $options);
}
}
@@ -175,9 +177,10 @@ abstract class BaseRenderer extends Component
* generate link markup
* @param $text
* @param $href
+ * @param array $options additional HTML attributes for the link.
* @return mixed
*/
- protected abstract function generateLink($text, $href);
+ protected abstract function generateLink($text, $href, $options = []);
/**
* Generate an url to a type in apidocs
diff --git a/extensions/apidoc/templates/bootstrap/assets/css/style.css b/extensions/apidoc/templates/bootstrap/assets/css/style.css
index 03c8f19f85..8833636680 100644
--- a/extensions/apidoc/templates/bootstrap/assets/css/style.css
+++ b/extensions/apidoc/templates/bootstrap/assets/css/style.css
@@ -3,6 +3,10 @@ body {
height: 100%;
}
+.guide-content, .api-content {
+ max-width: 1250px;
+}
+
.wrap {
min-height: 100%;
height: auto;
@@ -35,9 +39,14 @@ body {
color: #fff;
}
-.signature, .signature2 {
- padding: 3px;
+.signature, .table-striped > tbody > tr > td.signature {
+ margin: 10px 0 10px 0;
+ padding: 8px;
+
color: #000000;
+ background: rgba(230, 236, 255, 0.81);
+ border: 1px rgba(191, 207, 255, 0.81) solid;
+
font-family: "courier new", "times new roman", monospace;
line-height: 1.3em;
white-space: pre-line;
@@ -45,12 +54,6 @@ body {
word-break: break-all;
}
-.signature {
- margin: 10px 0 10px 0;
- background: #E6ECFF;
- border: 1px #BFCFFF solid;
-}
-
blockquote {
font-size: 14px;
}
@@ -59,7 +62,50 @@ td p {
margin: 0;
}
-table.detailTable .paramNameCol { width: 15%; min-width: 100px; }
-table.detailTable .paramTypeCol { width: 15%; min-width: 150px; }
-table.detailTable .paramDescCol { width: 70%; }
+table.detail-table .param-name-col { width: 15%; min-width: 100px; }
+table.detail-table .param-type-col { width: 15%; min-width: 150px; }
+table.detail-table .param-desc-col { width: 70%; }
+table.summary-table .col-method { width: 20%; }
+table.summary-table .col-property { width: 20%; }
+table.summary-table .col-const { width: 20%; }
+table.summary-table .col-event { width: 20%; }
+table.summary-table .col-defined { width: 15%; }
+
+.detail-header {
+ margin-top: 30px;
+}
+
+.doc-description {
+ border-left: solid 1px #ddd;
+ border-right: solid 1px #ddd;
+ padding: 10px 8px;
+ margin: 0;
+}
+
+.event-doc .doc-description {
+ border-bottom: solid 1px #ddd;
+}
+
+.doc-description p:last-child {
+ margin-bottom: 0;
+}
+
+.tool-link {
+ float: right;
+ color: #ddd;
+ margin: 0 8px;
+}
+
+.icon-hash:before {
+ content: '#';
+ font-size: 32px;
+ font-weight: bold;
+ /*top: -10px;*/
+ line-height: 0.5;
+}
+
+.tool-link:hover {
+ color: #bbb;
+ text-decoration: none;
+}
\ No newline at end of file
diff --git a/extensions/apidoc/templates/bootstrap/layouts/api.php b/extensions/apidoc/templates/bootstrap/layouts/api.php
index d6a0002290..b7a5291f3d 100644
--- a/extensions/apidoc/templates/bootstrap/layouts/api.php
+++ b/extensions/apidoc/templates/bootstrap/layouts/api.php
@@ -44,7 +44,7 @@ $this->beginContent('@yii/apidoc/templates/bootstrap/layouts/main.php'); ?>
'view' => $this,
])?>
-
diff --git a/extensions/apidoc/templates/bootstrap/layouts/guide.php b/extensions/apidoc/templates/bootstrap/layouts/guide.php
index 0cad275014..941dc7002b 100644
--- a/extensions/apidoc/templates/bootstrap/layouts/guide.php
+++ b/extensions/apidoc/templates/bootstrap/layouts/guide.php
@@ -32,7 +32,7 @@ $this->beginContent('@yii/apidoc/templates/bootstrap/layouts/main.php'); ?>
'view' => $this,
]) ?>
-
diff --git a/extensions/apidoc/templates/html/ApiRenderer.php b/extensions/apidoc/templates/html/ApiRenderer.php
index d78d22ecae..06dcab5873 100644
--- a/extensions/apidoc/templates/html/ApiRenderer.php
+++ b/extensions/apidoc/templates/html/ApiRenderer.php
@@ -246,8 +246,8 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
return ($method->isReturnByReference ? '&' : '')
. ($method->returnType === null ? 'void' : $this->createTypeLink($method->returnTypes))
- . ' ' . $this->createSubjectLink($method, $method->name)
- . ApiMarkdown::highlight('( ' . implode(', ', $params) . ' )', 'php');
+ . ' ' . $this->createSubjectLink($method, $method->name) . ''
+ . ApiMarkdown::highlight(str_replace(' ', ' ', '( ' . implode(', ', $params) . ' )'), 'php');
}
public function generateApiUrl($typeName)
@@ -271,14 +271,12 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
}
/**
- * generate link markup
- * @param $text
- * @param $href
- * @return mixed
+ * @inheritdoc
*/
- protected function generateLink($text, $href)
+ protected function generateLink($text, $href, $options = [])
{
- return Html::a($text, null, ['href' => $href]);
+ $options['href'] = $href;
+ return Html::a($text, null, $options);
}
public function getSourceUrl($type)
diff --git a/extensions/apidoc/templates/html/GuideRenderer.php b/extensions/apidoc/templates/html/GuideRenderer.php
index a5d4451ed6..2ac7fd1ddb 100644
--- a/extensions/apidoc/templates/html/GuideRenderer.php
+++ b/extensions/apidoc/templates/html/GuideRenderer.php
@@ -138,14 +138,12 @@ abstract class GuideRenderer extends BaseGuideRenderer
}
/**
- * generate link markup
- * @param $text
- * @param $href
- * @return mixed
+ * @inheritdoc
*/
- protected function generateLink($text, $href)
+ protected function generateLink($text, $href, $options = [])
{
- return Html::a($text, null, ['href' => $href]);
+ $options['href'] = $href;
+ return Html::a($text, null, $options);
}
/**
diff --git a/extensions/apidoc/templates/html/views/constSummary.php b/extensions/apidoc/templates/html/views/constSummary.php
index f5c90ec269..a85df81471 100644
--- a/extensions/apidoc/templates/html/views/constSummary.php
+++ b/extensions/apidoc/templates/html/views/constSummary.php
@@ -18,27 +18,28 @@ if (empty($type->constants)) {
$constants = $type->constants;
ArrayHelper::multisort($constants, 'name');
?>
-
-
Constants
+
+
Constants
-
Hide inherited constants
+
Hide inherited constants
-
-
-
-
-
-
-
- | Constant | Value | Description | Defined By |
-
-
- definedBy != $type->name ? ' class="inherited"' : '' ?> id="= $constant->name ?>">
- | = $constant->name ?> |
- = $constant->value ?> |
- = ApiMarkdown::process($constant->shortDescription . "\n" . $constant->description, $constant->definedBy, true) ?> |
- = $renderer->createTypeLink($constant->definedBy) ?> |
+
+
+
+
+
+
+
+
+ | Constant | Value | Description | Defined By |
-
-
+
+
definedBy != $type->name ? ' class="inherited"' : '' ?> id="= $constant->name ?>">
+ | = $constant->name ?> |
+ = $constant->value ?> |
+ = ApiMarkdown::process($constant->shortDescription . "\n" . $constant->description, $constant->definedBy, true) ?> |
+ = $renderer->createTypeLink($constant->definedBy) ?> |
+
+
+
\ No newline at end of file
diff --git a/extensions/apidoc/templates/html/views/eventDetails.php b/extensions/apidoc/templates/html/views/eventDetails.php
index c2aa217145..f3ecb9ae87 100644
--- a/extensions/apidoc/templates/html/views/eventDetails.php
+++ b/extensions/apidoc/templates/html/views/eventDetails.php
@@ -7,8 +7,11 @@ use yii\helpers\ArrayHelper;
/**
* @var ClassDoc $type
* @var yii\web\View $this
+ * @var \yii\apidoc\templates\html\ApiRenderer $renderer
*/
+$renderer = $this->context;
+
$events = $type->getNativeEvents();
if (empty($events)) {
return;
@@ -16,10 +19,24 @@ if (empty($events)) {
ArrayHelper::multisort($events, 'name');
?>
Event Details
+
+
- */ ?>
+
+ = ApiMarkdown::process($event->description, $type) ?>
- = ApiMarkdown::process($event->description, $type) ?>
-
- = $this->render('seeAlso', ['object' => $event]) ?>
+ = $this->render('seeAlso', ['object' => $event]) ?>
+
+
diff --git a/extensions/apidoc/templates/html/views/eventSummary.php b/extensions/apidoc/templates/html/views/eventSummary.php
index 57fcef48a4..ce8c0ab3ed 100644
--- a/extensions/apidoc/templates/html/views/eventSummary.php
+++ b/extensions/apidoc/templates/html/views/eventSummary.php
@@ -18,32 +18,33 @@ if (empty($type->events)) {
$events = $type->events;
ArrayHelper::multisort($events, 'name');
?>
-
-
Events
+
+
Events
-
Hide inherited events
+
Hide inherited events
-
-
-
-
-
-
-
- | Event | Type | Description | Defined By |
-
-
-definedBy != $type->name ? ' class="inherited"' : '' ?> id="= $event->name ?>">
- | = $renderer->createSubjectLink($event) ?> |
- = $renderer->createTypeLink($event->types) ?> |
-
- = ApiMarkdown::process($event->shortDescription, $event->definedBy, true) ?>
- since)): ?>
- (available since version = $event->since ?>)
-
- |
- = $renderer->createTypeLink($event->definedBy) ?> |
-
-
-
+
+
+
+
+
+
+
+
+ | Event | Type | Description | Defined By |
+
+
+ definedBy != $type->name ? ' class="inherited"' : '' ?> id="= $event->name ?>">
+ | = $renderer->createSubjectLink($event) ?> |
+ = $renderer->createTypeLink($event->types) ?> |
+
+ = ApiMarkdown::process($event->shortDescription, $event->definedBy, true) ?>
+ since)): ?>
+ (available since version = $event->since ?>)
+
+ |
+ = $renderer->createTypeLink($event->definedBy) ?> |
+
+
+
diff --git a/extensions/apidoc/templates/html/views/methodDetails.php b/extensions/apidoc/templates/html/views/methodDetails.php
index 4e6066846c..a3db465ebf 100644
--- a/extensions/apidoc/templates/html/views/methodDetails.php
+++ b/extensions/apidoc/templates/html/views/methodDetails.php
@@ -21,11 +21,23 @@ ArrayHelper::multisort($methods, 'name');
?>
Method Details
+
-