Ray Kootstra Ray Kootstra - 24 days ago
111 0

Script to check environment by kernel / container.

PHP

Symfony2 check environment by container

$kernel = $this->container->get('kernel');
// if dev environment
if (in_array($kernel->getEnvironment(), ['dev'])) {
    // Do something
}
Comments