Update links to the new documentation website

This commit is contained in:
Frédéric Guillot
2022-11-12 10:23:29 -08:00
committed by Frédéric Guillot
parent a376ffbe53
commit 80c073432f
7 changed files with 14 additions and 21 deletions

View File

@@ -23,17 +23,9 @@ class UrlHelper extends Base
* @param string $file
* @return string
*/
public function doc($label, $file)
public function doc($label, $file = '')
{
$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);
$url = sprintf(DOCUMENTATION_URL_PATTERN, 'v1', $file);
return sprintf('<a href="%s" target="_blank">%s</a>', $url, $label);
}