Inheritance: extends yii\web\Controller
Ejemplo n.º 1
0
 /**
  * Deletes an existing Category model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     if (Yii::$app->user->can('admin')) {
         $this->findModel($id)->delete();
         return $this->redirect(['index']);
     } else {
         return parent::actionLogin();
     }
 }
 public function actions()
 {
     return ArrayHelper::merge(['generarRutaAuto'], parent::actions());
 }