when i want to connect database in zend framework with zend_Db, in each controller or model must write this code:
$params = array(
'host' => '127.0.0.1',
'username' => 'webuser',
'password' => 'xxxxxxxx',
'dbname' => 'test',
'charset' => 'utf8'
);
but when use Doctrine it’s enough to write this code in application.ini
doctrine.dsn = "mysql://user:pass@localhost/dbase"
how i can use zend_Db with out set connection setting in each file?
open
add following lines
and then inside your Bootstrap.php
do
and then whereever or whenever you need db instance simply do