Add sAPPROOTURL to the data of the twig

This commit is contained in:
Eric Espie
2025-11-19 10:06:16 +01:00
parent 24d78df21d
commit e95ce21188

View File

@@ -169,7 +169,10 @@ abstract class Controller extends AbstractController
$this->SetViewPath($sViewPath, $aAdditionalPaths);
if ($sModuleName != 'core') {
try {
$this->aDefaultParams = ['sIndexURL' => utils::GetAbsoluteUrlModulePage($this->m_sModule, 'index.php')];
$this->aDefaultParams = [
'sIndexURL' => utils::GetAbsoluteUrlModulePage($this->m_sModule, 'index.php'),
'sAPPROOTURL' => utils::GetAbsoluteUrlAppRoot(),
];
} catch (Exception $e) {
IssueLog::Error($e->getMessage());
}
@@ -197,7 +200,10 @@ abstract class Controller extends AbstractController
$this->SetModuleName(basename($sModulePath));
$this->SetViewPath($sModulePath.'/view');
try {
$this->aDefaultParams = ['sIndexURL' => utils::GetAbsoluteUrlModulePage($this->m_sModule, 'index.php')];
$this->aDefaultParams = [
'sIndexURL' => utils::GetAbsoluteUrlModulePage($this->m_sModule, 'index.php'),
'sAPPROOTURL' => utils::GetAbsoluteUrlAppRoot(),
];
} catch (Exception $e) {
IssueLog::Error($e->getMessage());
}