Commit c9895044 by Qiang Xue

Allow customizing GuideRenderer::apiUrl [skip ci]

parent 3090d280
...@@ -55,7 +55,9 @@ class GuideController extends BaseController ...@@ -55,7 +55,9 @@ class GuideController extends BaseController
// setup reference to apidoc // setup reference to apidoc
if ($this->apiDocs !== null) { if ($this->apiDocs !== null) {
$path = $this->apiDocs; $path = $this->apiDocs;
$renderer->apiUrl = $path; if ($renderer->apiUrl === null) {
$renderer->apiUrl = $path;
}
// use relative paths relative to targetDir // use relative paths relative to targetDir
if (strncmp($path, '.', 1) === 0) { if (strncmp($path, '.', 1) === 0) {
$renderer->apiContext = $this->loadContext("$targetDir/$path"); $renderer->apiContext = $this->loadContext("$targetDir/$path");
...@@ -63,7 +65,9 @@ class GuideController extends BaseController ...@@ -63,7 +65,9 @@ class GuideController extends BaseController
$renderer->apiContext = $this->loadContext($path); $renderer->apiContext = $this->loadContext($path);
} }
} elseif (file_exists($targetDir . '/cache/apidoc.data')) { } elseif (file_exists($targetDir . '/cache/apidoc.data')) {
$renderer->apiUrl = './'; if ($renderer->apiUrl === null) {
$renderer->apiUrl = './';
}
$renderer->apiContext = $this->loadContext($targetDir); $renderer->apiContext = $this->loadContext($targetDir);
} else { } else {
$renderer->apiContext = new Context(); $renderer->apiContext = new Context();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment