Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ublic function actionCreate()
- {
- $model_agent =new AgentProfile;
- $model_user =new User;
- // Uncomment the following line if AJAX validation is needed
- // $this->performAjaxValidation($model);
- if(isset($_POST['AgentProfile'], $_POST['User']))
- {
- $model_agent->attributes=$_POST['AgentProfile'];
- $model_user->attributes=$_POST['User'];
- $model_user->role = $model_user::AGENT_ROLE;
- $model_user->type = $model_user::PROFILE_AGENT;
- $valid=$model_agent->validate();
- $valid=$model_user->validate() && $valid;
- if($valid){
- $model_agent->safe(false);
- $model_user->safe(false);
- $this->redirect(array('view','id'=>$model->agent_profile_id));
- }
- }
- $this->render('create',array(
- 'model_agent'=>$model_agent,
- 'model_user'=>$model_user,
- ));
- }
Add Comment
Please, Sign In to add comment