I would like to access to my global configs (config/{,*.}{global,local}.php
) located in my personal libraries (in the vendor
directory).
But despite my search in the web, I did not succeed to achieve this.
I know how to access the config file of a module :
\MyModule\Module::getConfig()
I know how to access the global configurations from a controller :
$this->getServiceLocator()->get('config');
But how to access these from a file inside the vendor directory ? My libraries do not extend anything, it may be the root of the problem ? Can I use a static method to access these ?
Thanks.
easy way to do this. not only in module but anywhere.
define
APPLICATION_PATH
in public/index.phpYou can get it through the serviceManager. In controller:
Otherwise same way, just you need service Manager, for eaxmple in Module.php: