I am facing a problem with insert data using save(). using save() i successfully update data.but when the data is not exist in database with perticular id it not insert data.
controller :

```
public function actionContact()
  {
    //$profile=new Profile();
    $id=YII::$app->user->id;

    //$users=User::find()->where('id='.$id)->one();

    //$profiles=Profile::find()->where('user_id='.$id)->one();
    $this->layout="profile";
    $profile=$this->findModel1($id);
    $data=Yii::$app->request->post();

    if($data && $profile->validate()){

    $profile->mobile=Yii::$app->request->post('mobile');
    $profile->city=Yii::$app->request->post('city');
    $profile->zip=Yii::$app->request->post('zip');
    $profile->address=Yii::$app->request->post('zip');
    $profile->save();

    Yii::$app->session->setFlash("Contact-success", Yii::t("user", "Contact updated"));
    return $this->refresh();        
     }

    return $this->redirect(['/users/edit']);

  }

```

Any solution will highly appriciated.