コード例 #1
0
ファイル: TestController.php プロジェクト: mops1k/yiimine
 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
ファイル: TestImage.php プロジェクト: mops1k/yiimine
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTest()
 {
     return $this->hasOne(Test::className(), ['id' => 'test_id']);
 }