public function actionInsert() { //插入一行数据 $world = new World(); $world->user = '******'; $world->save(); // 一行新数据插入 customer 表 }
/** * Creates a new World model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new World(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }