database - Getting the db name or url used from models in php activerecord? -
how can database name or url used in models in php activerecord?
i have
$connections = array( 'conn1' => 'mysql://user:pass1@localhost/db1;charset=utf8', 'conn2' => 'mysql://user:pass2@localhost/db2;charset=utf8', 'conn3' => 'mysql://user:pass3@localhost/db3;charset=utf8' );
i need know database using models, want object method strings conn1
or mysql://user:pass1@localhost/db1;charset=utf8
i found way:
activerecord\config::instance()->get_default_connection_string()
php database phpactiverecord
No comments:
Post a Comment