I am having two table comment1(id,content,create_time) and comment2(id,content,create_time)
I click on create comment1 and after writing someting in comment1 content box and clicking on create the same data should also get saved in comment2 content table.
public function actionCreateComment1() //for the first button
{
$model=new Comment1;
if(isset($_POST['Comment']))
{
$model->attributes=$_POST['Comment'];
$model->save();
}
$this->render('create',array(
'model'=>$model,
));
}
public function actionCreateComment2() //for the second button
{
$model=new Comment2;
if(isset($_POST['Comment']))
{
$model->attributes=$_POST['Comment'];
$model->save();
}
$this->render('create',array(
'model'=>$model,
));
}
Can you please also help me in the below link if you can, I am following the below link and waiting for someone to update. I am also creating similar kind of thing.