I’ve just joined the forum. For the last few days, I’ve been looking into Yii and I’m starting my first web application with it, so I guess it’s normal to have a few questions.
I'm trying to modify the [tt]authenticate()[/tt] method of [tt]UserIdentity[/tt] of the default web application (as the yiic tool sets it up). I want to use the [tt]CDbConnection[/tt] object that is set up as an application component (I have modified [tt]main.php[/tt] to use a database connection), but I see that there is no default connection object.
then you can then access the DB connection via Yii::app()->db which is already activated automatically, unless you explictly configure CDbConnection::autoConnect to be false. Using
this approach, the single DB connection can be shared in multiple places in our code.