Exemplo n.º 1
0
 /**
       "Accion" para crear un nuevo registro en la tabla novedades 
 */
 public function actionCreate()
 {
     $model = new Novedades();
     $timezone = new \DateTimeZone('America/Argentina/Buenos_Aires');
     $date = new \DateTime('now', $timezone);
     $model->fecha = $date->format('Y-m-d');
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect('inicio');
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }