Does Grav have an environment variable, accessible via Twig, that can return the operating environment: production or development?
If not, is there a way to set such a variable in a site specific configuration file?
Does Grav have an environment variable, accessible via Twig, that can return the operating environment: production or development?
If not, is there a way to set such a variable in a site specific configuration file?
Currently its not really accessible via twig. It’s determined in the ConfigServiceProvider.php file. I think this could be valuable though, so stand by!
Ok, i’ve moved this logic to the URI object, so if you are able to update to the current GitHub version, you will be able to do this {{ uri.environment }}
to output the current environment
Commit: https://github.com/getgrav/grav/commit/78279e4d7a61df93afe6371546648a035bc6992d
BTW this is going to be localhost
or www.myserver.com
. These are the same values that Grav uses to differentiate the configuration settings.
I would just need ConfigServiceProvider.php?
actually you would only need to grab the updated Uri.php
.