/** * Creates a new Hito model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Hito(); if ($model->load(Yii::$app->request->post()) && $model->save()) { $model->fecha = date('Y-m-d h:m:s'); $model->save(); return $this->redirect(['view', 'id' => $model->id_hito]); } else { return $this->render('create', ['model' => $model]); } }