i am new to Zend Framework and i want to know how to get the application environment in my controller.
I read in a forum to use:
echo getenv('APPLICATION_ENV'); but it does not work.
APPLICATION_ENV is a constant, you can access it simply with:
But the question is why would you need it in your controller.
There is another way to get the environment name. It’s a little more OO-friendly for those of us who prefer to avoid globally defined constants, but I’m not quite sure how to get at it:
$myEnvName = $zendApplicationInstance->getEnvironment();
The question here is how to get the reference to
$myEnvName — suggestions welcome.