Example #1
0
 /**
  * Deletes an existing Post model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * 
  * @param  integer $id
  * @return mixed
  *
  * @throws NotFoundHttpException
  */
 public function actionDelete($id)
 {
     $postModel = new Post();
     $postModel->findModel($id)->delete();
     return $this->redirect('admin');
 }