Search code examples
phpzend-frameworktwigdevelopment-environment

How to get APPLICATION_ENV in Twig for Zend Framework


How can I use APPLICATION_ENV in the Zend Framework Twig file? For example in a controller we can use

if (APPLICATION_ENV == 'development') {
  ..
}

How can I write the same in a Twig file?


Solution

  • If APPLICATION_ENV is a constant, you can access it through Twig's constant function