I have some features that I only want shown when the website is run in dev mode (or in development environment). How can I programmatically determine what environment is currently being used?
E.g.
// $inDevEnvironment = ?
if ($inDevEnvironment) {
// DEV feature here
}
Use sfConfig::get('sf_environment');
. It returns the string dev
when in dev environment.
See this page for more info: http://sunzhen.blogspot.com/2012/02/symfony-get-working-environmentdevelopm.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With