Closed ec-ecss closed 1 year ago
Pass it to service parameter first and then use that
Hello thank you very much for your answer. I'm so sorry... but could you just specify what is the service you talk about, and "it" and "that" ? It's not clear for me... I know well sf, but not sonata.
in parameters.yml
parameters:
skin: "env..
and then in sonata_admin.yml you should be able to access that with %skin%
Tx. I've tried :
parameters:
app_skin: '%env(APP_SKIN)%'
sonata_admin:
title: '%env(APP_TITLE)%'
dashboard:
blocks:
- { type: sonata.admin.block.admin_list, position: left }
title_logo: '%env(APP_LOGO)%'
options:
skin: '%app_skin%'
But still got error The value "" is not allowed for path "sonata_admin.options.skin". Permissible values: "skin-black", etc...
Obviously the APP_SKIN is well defined in .env.local
APP_SKIN='skin-red-light'
Maybe you can do something like:
parameters:
env(APP_SKIN): 'skin-red-light' # default value
And then it will be overriden with the env value on your .env
Besides this, not sure what else we could do. This is a symfony feature that we are using. We need to make sure the value on that config option is a valid option.
Closing for now. If my suggestion does not work and you have an idea on how we could improve this (knowing that this might be a symfony issue), please let us know.
Thank you.
Feature Request
I am on admin-bundle 4.9 The config variable sonata_admin.options.skin needs a constant string Is it possible to make it customizable with a environnement variable ? Currently a "%env(SOMETHING)% is not functionnal and an exception about a empty string is triggered