Since: 1.0
Author: Misbahul D Munir (misbahuldmunir@gmail.com)
Inheritance: extends yii\base\Model
コード例 #1
0
 /**
  * Refresh cache
  * @return type
  */
 public function actionRefresh()
 {
     $model = new Route();
     $model->invalidate();
     Yii::$app->getResponse()->format = 'json';
     return $model->getRoutes();
 }
コード例 #2
0
 /**
  * Creates a new AuthItem model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Route();
     if ($model->load(Yii::$app->getRequest()->post())) {
         if ($model->validate()) {
             $routes = preg_split('/\\s*,\\s*/', trim($model->route), -1, PREG_SPLIT_NO_EMPTY);
             $this->saveNew($routes);
             MenuHelper::invalidate();
             $this->redirect(['index']);
         }
     }
     return $this->render('create', ['model' => $model]);
 }