我想使用教义数据库配置访问教义中的 DBAL 层,我的教义数据库文件配置中有以下配置:database.local.php
return array(
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOPgSql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '5432',
'user' => 'postgres',
'password' => '123456',
'dbname' => 'test'
)
)
)
)
);
在我的控制器 IndexController.php
use Doctrine\DBAL\DriverManager;
public function testAction(){
$conn = DriverManager::getConnection($params, $config);
}
我想在 getConnection 函数中使用上面的 db config,这可能吗?