/**
  * Updates an existing Category model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     $categoryArray = Category::getCategoryArray();
     $viewArray = Category::getPageViewArray();
     $positionArray = Category::getCategoryPositionArray();
     $statusArray = Category::getCategoryStatusArray();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('update', ['model' => $model, 'categoryArray' => $categoryArray, 'viewArray' => $viewArray, 'positionArray' => $positionArray, 'statusArray' => $statusArray]);
     }
 }