Customizing the user registration process

I have added a ‘role_id’ to my User model, and also a user_id reference in my ‘office’ model.

In so doing, I need to be able to update those fields when a new User registration is processed - adding the correct role_id, and then adding the new users ID to the office table.

I have no idea how to customize the User registration process so any links, suggestions, examples would be great :)

Maybe, what are you looking for is Behaviors and Events. Read these articles from the guide to point you to the right direction: Events Behaviors




if(isset($_POST['User'])) {

     $model->attributes=$_POST['User'];

     if($model->save()) { 					

         if(isset($_POST['Office'])) { 						

             $office->attributes=$_POST['office'];       

$office->user_id=$model->id; 	                 				 $office->save(); 					

}

}

}