http://book.cakephp.org/2.0/en/models/model-attributes.html
app/Config/database.php
class DATABASE_CONFIG {
public $default = array(
…………………
);
public $company_db_name = array(
………………...
);
}
app/Model/Example.php
class Example extends AppModel {
public $useDbConfig = 'company_db_name';
}
Andras Kende
http://www.kende.com
On Sep 12, 2013, at 1:57 AM, Olivier CHEMIN <olivier.chemin@gmail.com> wrote:
> Hi all,
>
> I have an app wich uses multiple databases.
>
> One database ('default') for common information, users, companies, etc. The login function from the usersController uses this database.
>
> The rest of the data is stored into another database (let say a company_db_name), so after the user has logged in i would like to create the connection for this company_db_name and keep it available for the whole user session.
>
> I have tried different ways of doing this but it seems i have reached an impass...
>
> Any idea of a nice cakephp way to do this ?
>
> Thanks !
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
Thursday, September 12, 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment