Search code examples
zend-frameworkconfigzf3

how to access local.php file from controller in zf3


I am working with Zend-framework 3. I want to access the content of config files (local.php) in the controller. please explain. Thank you all in advance.


Solution

  • After some research, I found the simplest way to access any config file. Just in your Module.php pass $container->get('config') as one of the argument to your controller's constructor and voila you can now access any property in the controller. That much simple. :-) Happy coding..!!