/** * Refresh cache * @return type */ public function actionRefresh() { $model = new Route(); $model->invalidate(); Yii::$app->getResponse()->format = 'json'; return $model->getRoutes(); }
/** * 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]); }