Ejemplo n.º 1
0
 public function delete()
 {
     if (!isset($_GET['id'])) {
         die("Please, specify id");
     }
     $id = $_GET['id'];
     $model = PostModel::model()->getById($id);
     if ($model->isNewRecord()) {
         die("Post with id {$id} is not found!");
     }
     $model->delete();
     $this->redirect('index');
 }