Search code examples
phpzend-framework

Get application environment constant in Zend Framework


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.


Solution

  • Since APPLICATION_ENV is a constant, you can access it simply with:

    echo APPLICATION_ENV;
    

    But the question is why would you need it in your controller.