Ejemplo n.º 1
0
 /**
  * Deletes an existing UserJob 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(UserJob::moduleName() . ':delete')) {
         return $this->render('//message', ['messages' => ['danger' => Yii::t('yii', 'You are not allowed to perform this action.')]]);
     }
     $this->findModel($id)->delete();
     return $this->redirect(['index']);
 }