public function actionBlog() { $blogs = BlogModel::model()->order("id DESC")->findAll(); $this->view("blog", array("posts" => $blogs), false); }
public function actionBlogDelete($id) { BlogModel::model()->where("`id`='" . (int) $id . "'")->delete(); $this->redirect("/admin/blog"); }