{# @var services \Shopware\Core\Framework\Script\ServiceStubs #}
{% set myInt = services.config.app('myInt') %}
I thought this is the way to got, according to the documentation, but i do not get the result, its always null.
Just tested this with the current stable release and it works as expected.
{% do debug.dump(services.config.app('example')) %}
Shows the value of MyAppTechnicalName.config.example
in the scripts section of the profiler.
The system config facade of the service stubs will always take the current sales channel id to get the config values. That means, if you haven't provided a value for all sales channels, but a value for one sales channel and not the other, then you might get no value depending on the sales channel context you're in.
Verify that the value is stored correctly in the table system_config
with the configuration_key
being of the pattern MyAppTechnicalName.config.example
and sales_channel_id
being null
, indicating a fallback value for all sales channels.