/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new MenuType();
     if (isset($_POST['MenuType'])) {
         $model->attributes = $_POST['MenuType'];
         if ($model->validate()) {
             if ($model->save()) {
                 Yii::app()->user->setFlash('success', Yii::t('menutype', 'Add menutype successfully.'));
             } else {
                 Yii::app()->user->setFlash('error', Yii::t('menutype', 'Add menutype failed. Please try it later.'));
             }
             $this->redirect(array('/' . backend . '/menutype/admin'));
         }
     }
     $this->render(strtolower($this->action->Id), array('model' => $model));
 }