Search code examples
environment-variablestwigshopwareshopware6

Is there a way to check if Shopware6 Twig Template is running in DEV mode?


In order to ouput special debug information, I'd like to only show it in the template if the shop is running in DEV mode.

I tried to read the ENV Variable without any success:

{{ app.request.server.get('APP_ENV') }}

Or is something like this possible?

{{ app.appVariable.get('environment') }}

Solution

  • You may use app.environment

    {% set isDebug = app.environment == 'dev' %}