N°8274 - Add approot to portal's Symfony variables. Allow portal's twig to display images located in /images in twig

This commit is contained in:
Stephen Abello
2025-04-02 11:15:45 +02:00
parent a4166f874e
commit 09c092782c
3 changed files with 4 additions and 0 deletions

View File

@@ -133,6 +133,7 @@ if (!defined('PORTAL_ID'))
// Env. vars to be used in templates and others
$_ENV['COMBODO_CURRENT_ENVIRONMENT'] = utils::GetCurrentEnvironment();
$_ENV['COMBODO_APPROOT'] = APPROOT;
$_ENV['COMBODO_ABSOLUTE_URL'] = utils::GetAbsoluteUrlAppRoot();
$_ENV['COMBODO_CONF_APP_ICON_URL'] = MetaModel::GetConfig()->Get('app_icon_url');
$_ENV['COMBODO_MODULES_ABSOLUTE_URL'] = utils::GetAbsoluteUrlModulesRoot();

View File

@@ -1,5 +1,7 @@
twig:
default_path: '%combodo.modules.absolute_path%'
paths:
'%combodo.approot%images/': ~
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'

View File

@@ -27,6 +27,7 @@ parameters:
# Used in templates
combodo.current_environment: '%env(string:COMBODO_CURRENT_ENVIRONMENT)%'
combodo.approot: '%env(string:COMBODO_APPROOT)%'
combodo.absolute_url: '%env(string:COMBODO_ABSOLUTE_URL)%'
combodo.conf.app_icon_url: '%env(string:COMBODO_CONF_APP_ICON_URL)%'
combodo.modules.absolute_url: '%env(string:COMBODO_MODULES_ABSOLUTE_URL)%'