/** * Creates a new ApiLogs model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new ApiLogs(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }
public static function write($nik) { $apiLog = new ApiLogs(); $apiLog->id = null; $apiLog->ip = $_SERVER['REMOTE_ADDR']; $apiLog->nik = $nik; $apiLog->uri_access = $_SERVER['REQUEST_URI']; $apiLog->method = $_SERVER['REQUEST_METHOD']; $apiLog->save(); }