I have 2 tables which are [color="#FFFF00"]useraccounts[/color] and [color="#FFFF00"]basicdetails[/color]. and I have CRUD for each tables.
What I want is in the form input for create useraccounts should be fill up first followed by form input for create basicdetails then after completing this 2 forms then only the data will be saved to the 2 tables.
public function actionCreate()
{
$model=new Useraccounts;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['Useraccounts']))
{
$model->attributes=$_POST['Useraccounts'];
if($model->save())
$this->redirect(array('view','id'=>$model->id,));
}
$this->render('create',array(
'model'=>$model,
));
}
public function actionCreate()
{
$model=new Basicdetails;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['Basicdetails']))
{
$model->attributes=$_POST['Basicdetails'];
if($model->save())
$this->redirect(array('view','id'=>$model->id));
}
$this->render('create',array(
'model'=>$model,
));
}