Where to put authManager config code?

Here is the code from the Guide in the Authorization special topic part:


return array(

    'components'=>array(

        'db'=>array(

            'class'=>'CDbConnection',

            'connectionString'=>'sqlite:path/to/file.db',

        ),

        'authManager'=>array(

            'class'=>'CDbAuthManager',

            'connectionID'=>'db',

        ),

    ),

);

Where shall I place this code? is it main.php or some kind of init()?

I have to say don’t know where to put the code even after the tutorial is the biggest challenge for beginner like me.

Thank you!

in protected/config/main.php

Yes, thank you Gustavo!

It should go into the


'components'=>array(

		....

inside the big array in side the main.php, otherwise it will generate CExcpetion.

God, why they didn’t mentioned this in the official guide~

Nicolas

Glad I could help

Probably because that they, me included, are so used to Yii that they forget what may or may not be hard at the begining

Cheers