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?
Eg
// $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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.