Allow customizing GuideRenderer::apiUrl [skip ci]

This commit is contained in:
Qiang Xue
2014-11-18 23:19:12 -05:00
parent 3090d28038
commit c98950442c

View File

@ -55,7 +55,9 @@ class GuideController extends BaseController
// setup reference to apidoc
if ($this->apiDocs !== null) {
$path = $this->apiDocs;
$renderer->apiUrl = $path;
if ($renderer->apiUrl === null) {
$renderer->apiUrl = $path;
}
// use relative paths relative to targetDir
if (strncmp($path, '.', 1) === 0) {
$renderer->apiContext = $this->loadContext("$targetDir/$path");
@ -63,7 +65,9 @@ class GuideController extends BaseController
$renderer->apiContext = $this->loadContext($path);
}
} elseif (file_exists($targetDir . '/cache/apidoc.data')) {
$renderer->apiUrl = './';
if ($renderer->apiUrl === null) {
$renderer->apiUrl = './';
}
$renderer->apiContext = $this->loadContext($targetDir);
} else {
$renderer->apiContext = new Context();