backend/controllers/MaintenanceController.php
/**
     * Lists all Preferences models.
     * @return mixed
     */
Lists all Preferences models.
@return mixed
Lists all Preferences models . @return mixed
public function actionIndex()
    {
        $model = new Maintenance();
        if ($model->load(Yii::$app->request->post()) && $model->validate()) {
            if ($model->setMaintenance()) {
                Yii::$app->session->setFlash('success', 'Saved!');
            } else {
                Yii::$app->session->setFlash('error', Json::encode($model->getErrors()));
            }
            return $this->redirect(['index']);
        }
        return $this->render('index', [
            'model' => Maintenance::getMaintenance(),
        ]);
    }
public function actionIndex ( ) { $ model = new Maintenance ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> validate ( ) ) { if ( $ model -> setMaintenance ( ) ) { Yii :: $ app -> session -> setFlash ( 'success' , 'Saved!' ) ; } else { Yii :: $ app -> session -> setFlash ( 'error' , Json :: encode ( $ model -> getErrors ( ) ) ) ; } return $ this -> redirect ( [ 'index' ] ) ; } return $ this -> render ( 'index' , [ 'model' => Maintenance :: getMaintenance ( ) , ] ) ; }
Lists all Preferences models.
Lists all Preferences models .