summaryrefslogtreecommitdiff
path: root/app/Helper
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2018-04-06 10:54:58 -0700
committerFrédéric Guillot <fred@kanboard.net>2018-04-06 10:54:58 -0700
commit0b306fa60ad84ea077111e0ff7b59208ba7bc8a3 (patch)
tree5d8941b5950ede2db8ca3fba0213792db0f07a50 /app/Helper
parentac11220a1aa7ae30b8827d9bbf221888d3edd0a7 (diff)
Move documentation to https://docs.kanboard.org/
Diffstat (limited to 'app/Helper')
-rw-r--r--app/Helper/UrlHelper.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/Helper/UrlHelper.php b/app/Helper/UrlHelper.php
index 94412cf5..bd54fd94 100644
--- a/app/Helper/UrlHelper.php
+++ b/app/Helper/UrlHelper.php
@@ -25,7 +25,16 @@ class UrlHelper extends Base
*/
public function doc($label, $file)
{
- return $this->link($label, 'DocumentationController', 'show', array('file' => $file), false, '', '', true);
+ $version = 'latest';
+
+ if (substr(APP_VERSION, 0, 1) === 'v') {
+ $version = substr(APP_VERSION, 1);
+ } else if (ctype_digit(substr(APP_VERSION, 0, 1))) {
+ $version = APP_VERSION;
+ }
+
+ $url = sprintf(DOCUMENTATION_URL_PATTERN, $version, $file);
+ return sprintf('<a href="%s" target="_blank">%s</a>', $url, $label);
}
/**