public function actionCreate($fraid) { $model = new Fragment2Data(); $model->fragment_id = $fraid; $model->publish_time = TTimeHelper::getCurrentTime(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['index', 'fraid' => $fraid]); } else { $locals = []; $locals['model'] = $model; $locals['currentFragment'] = Fragment::findOne($fraid); return $this->render('create', $locals); } }