How could read application.ini on controller using zend framework

后端 未结 6 535
渐次进展
渐次进展 2021-01-06 23:50

I have these lines in my application.ini

how can I read user in my contrroler

resources.doctrine.dbal.connections.default.parameter         


        
6条回答
  •  粉色の甜心
    2021-01-07 00:32

    How about something like:

    $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
    $connectionParams = $config->resources->doctrine->connections;
    

    Or during Bootstrap, create and save this $config object in the Bootstrap or in the Zend_Registry for later retrieval in your controller.

提交回复
热议问题