/**
  * Creates a new CustomerRecord model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new CustomerRecord();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
Esempio n. 2
0
 private function load(CustomerRecord $customer, PhoneRecord $phone, array $post)
 {
     //var_dump($_POST);die;
     return $customer->load($post) and $phone->load($post) and $customer->validate() and $phone->validate(['number']);
 }
 private function load(CustomerRecord $customer, PhoneRecord $phone, array $post)
 {
     return $customer->load($post) and $phone->load($post) and $customer->validate() and $phone->validate(['number']);
 }