How do I get the path to the Resources / config folder as a string in the controller context in Symfony 2?
I tried to look into the container, but did not notice anything.
There is no built-in method to extract it, but it is easy to understand.
Inside the controller:
__DIR__.'/../Resources/config'
In fact, you will see your package extension class using it in the load() method.
load()
Or you can get the kernel service and then run
kernel
$kernel->locateResource('@NameOfBundle/Resources/config/filename');
$this->get('kernel')->getRootDir() . '/config';
getRootDir () always points to the application folder.
Source: https://habr.com/ru/post/903682/More articles:MySQL defaults to WHERE - mysqlHow to make ruby ββcommand line application with pager? - command-lineJava - displaying minimal JFrame window - javaJDbcTemplate IN for string elements - javaSmooth scrolling inside stackpanel in wpf - scrollWhy can't I see / debug javascript loaded by jquery.html () using Chrome - javascriptTrying to write an IRC client, but struggling to find a good resource regarding codes and connection protocol - c #node.js - sharing partitions between processes - node.jsHow does Linux connect many network cards with the same driver? - linux-kernelJava SSHD example - javaAll Articles