Blog Tutorial

Hi All,

I am following the blog tutorial. Instead of using a table called tbl_user, I am using a table called tbl_rider.

I have used the gii tool to make a model called Rider in Rider.php in the models folder. I have generated the CRUD functions and used the create form view to create one row in the table with the important columns email and password populated. I queried the table and row is there with an unecrypted password.

I assumed all I would need to do was replace all of the instances of User with Rider and the username with password and it would function correctly.

My code follows:

class UserIdentity extends CUserIdentity


        private $_id;


	public function authenticate()






                else if(!$rider->validatePassword($this->password))








                return $this->errorCode==self::ERROR_NONE;


        public function getId()


            return $this->_id;



My table tbl_rider has the columns: rider_id, email, password.

I get an exception - Property "" is not defined. This line is highlighted - $email=strtolower($this->email);

What’s the problem with my code?

Hi kingcharles,

"UserIdentity" and "User" ("Rider" in your case) are the different things.

I fixed did thanks to your help