summaryrefslogtreecommitdiff
path: root/app/Helper/UrlHelper.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Helper/UrlHelper.php')
-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);
}
/**