/** * @inheritdoc */ public static function Add($nombre = null, $role = null, $module = null, $submodule = null, $result = null, $info = null) { $model = new Logs(); $model->load(['Logs' => ['nombre' => $nombre, 'role' => $role, 'module' => $module, 'submodule' => $submodule, 'result' => $result, 'info' => $info, 'ip_address' => $_SERVER['REMOTE_ADDR'], 'fecha_registro' => Yii::$app->fn->GetDate('none'), 'hora_registro' => date("h:m")]]); //Fn::PrintVar($model); //exit; $model->save(); }
/** * Creates a new Logs model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Logs(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }