Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Environment Variable?

Started by Muut Archive 12 years ago · 5 replies · 738 views
12 years ago

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?

12 years ago

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!

12 years ago

BTW this is going to be localhost or www.myserver.com. These are the same values that Grav uses to differentiate the configuration settings.

12 years ago

I would just need ConfigServiceProvider.php?

12 years ago

actually you would only need to grab the updated Uri.php.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2887 9 years ago
Archive · by Muut Archive, 9 years ago
2 1882 9 years ago
Archive · by Muut Archive, 9 years ago
2 5214 9 years ago
Archive · by Muut Archive, 9 years ago
1 4033 9 years ago
Archive · by Muut Archive, 9 years ago
3 1970 9 years ago