Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

/container.php Secret

Created May 17, 2017 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3d2e94303de1332022591c68e96b194c to your computer and use it in GitHub Desktop.
Save anonymous/3d2e94303de1332022591c68e96b194c to your computer and use it in GitHub Desktop.
<?php
$di->set('db1', function() {
return new \Phalcon\Db\Adapter\Pdo\Mysql([
"host" => "localhost",
"username" => "",
"password" => "",
"dbname" => ""
]);
});
$di->set('db2', function() {
return new \Phalcon\Db\Adapter\Pdo\Mysql([
"host" => "localhost",
"username" => "",
"password" => "",
"dbname" => ""
]);
});
<?php
public function initialize(){
//puedes conectar a la base de datos que desees
$this->setConnectionService('db1');
//$this->setConnectionService('db2');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment