public function actionIndex() { $phone = Yii::$app->request->get('phone'); $email = Yii::$app->request->get('email'); $contact = new Contact(); $contact->setEmail($email); $contact->setPhone($phone); return $this->render('index', ["contact" => $contact]); }
/** * @return \yii\db\ActiveQuery */ public function getContacts() { return $this->hasMany(Contact::className(), ['company_id' => 'id']); }