Add _p.web_url variable in twig template BT#13169

pull/2487/head
jmontoyaa 8 years ago
parent d702205891
commit b092665a78
  1. 12
      main/inc/lib/api.lib.php
  2. 1
      main/inc/lib/template.lib.php

@ -8186,3 +8186,15 @@ function location($url, $exit = true)
exit;
}
}
/**
* @return string
*/
function api_get_web_url()
{
if (api_get_setting('server_type') == 'test') {
return api_get_path(WEB_PATH).'web/app_dev.php/';
} else {
return api_get_path(WEB_PATH).'web/';
}
}

@ -530,6 +530,7 @@ class Template
{
return [
'web' => api_get_path(WEB_PATH),
'web_url' => api_get_web_url(),
'web_relative' => api_get_path(REL_PATH),
'web_course' => api_get_path(WEB_COURSE_PATH),
'web_main' => api_get_path(WEB_CODE_PATH),

Loading…
Cancel
Save