0

I'm new to yii framework. I have two questions to ask :

  1. I have to create tabs for each table in the database test under which I have to have the menu for the rows of the table. How can I do this.
  2. For the application, I will be using the database test. But, for user login I will be using another database user. So, I need to use two databases.Currently, the skeleton application has only two usernames admin and demo. I need to retrieve many usernames from user table of user database. How can I do this in yii framework.
Michael Härtl
  • 8,428
  • 5
  • 35
  • 62
Rudra
  • 711
  • 7
  • 13
  • 31

1 Answers1

0

in your config.php file under components you can define the two databases like this.

return array(
    ...
    'components' => array(
        'db' => array(
            'connectionString' => 'mysql:host=dbserver1;dbname=my1db',
            ...
        ),
        'dbuser' => array(
            'connectionString' => 'mysql:host=adserver2;dbname=advertisingDB',
            'username'         => 'advertuser',
            'password'         => '***********',
            ...
            'class'            => 'CDbConnection'        
        ),
DevZer0
  • 13,433
  • 7
  • 27
  • 51