Пример #1
0
 public function actionCreate()
 {
     $model = new Test();
     if ($model->load(\Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['index']);
     }
     return $this->render('create', ['model' => $model]);
 }
Пример #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTest()
 {
     return $this->hasOne(Test::className(), ['id' => 'test_id']);
 }