To get the current environment in a Controller you can use:
$this->container->getParameter('kernel.environment');
So you just put that in an if() statement to check if it equals to dev.
To get the current environment in a Controller you can use:
$this->container->getParameter('kernel.environment');
So you just put that in an if() statement to check if it equals to dev.