How could read application.ini on controller using zend framework

后端 未结 6 556
渐次进展
渐次进展 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:33

    This goes in your controller.

    $bootstrap = $this->getInvokeArg('bootstrap');
    $appinidata = $bootstrap->getOptions();
    $user=$appinidata['resources']['doctrine']['dbal']['connections']['default']['parameters'] ['user'];
    

    This should print "root".

    print_r($user);
    

提交回复
热议问题