/** * Deletes an existing model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param string $id * @return mixed */ public function actionDelete($id) { if (!Yii::$app->user->can(LetArticle::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']); }