This commit is contained in:
Frédéric Guillot
2018-04-06 10:54:58 -07:00
parent ac11220a1a
commit 0b306fa60a
648 changed files with 15 additions and 38030 deletions

View File

@@ -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);
}
/**