/** * Creates a new ParsSettings model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new ParsSettings(); if ($model->load(Yii::$app->request->post())) { if ($model->validate()) { $model->save(); return $this->redirect(['view', 'id' => $model->id]); } } return $this->render('create', ['model' => $model]); }
/** * Displays homepage. * * @return mixed */ public function actionIndex() { $model = new ParsSettings(); if ($model->load(Yii::$app->request->post())) { $model->created = date("Y-m-d H:i:s", time() + 60 * ParsSettings::TIME_WAIT); if ($model->validate()) { $model->save(); return $this->redirect(Url::toRoute('pars/index')); } } return $this->render('index', ['model' => $model]); }