What is the best way to get the root app directory from inside the controller? Is it possible to get it outside of the controller?
Now I get it by passing it (from param
You can also use regular expression in addition to this:
$directoryPath = $this->container->getParameter('kernel.root_dir') . '/../web/bundles/yourbundle/'; $directoryPath = preg_replace("/app..../i", "", $directoryPath); echo $directoryPath;