Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

Environment Variable?

Started by Muut Archive 12 years ago · 5 replies · 413 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 1280 9 years ago
Archive · by Muut Archive, 9 years ago
2 888 9 years ago
Archive · by Muut Archive, 9 years ago
2 4018 9 years ago
Archive · by Muut Archive, 9 years ago
1 2893 9 years ago
Archive · by Muut Archive, 9 years ago
3 1077 9 years ago