public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('postSaved');
        }

        if ($model->type->show_category) {
            $model->setScenario('required_category');
        }

        return $this->render('update', ['model' => $model]);
    }