当前位置: 首页>>代码示例>>PHP>>正文


PHP Blog::destroy方法代码示例

本文整理汇总了PHP中Blog::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::destroy方法的具体用法?PHP Blog::destroy怎么用?PHP Blog::destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Blog的用法示例。


在下文中一共展示了Blog::destroy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete($id)
 {
     $Blog = new Blog($this->plural_resource);
     $sql = $Blog->destroy($id);
     mysqli_query($this->db, $sql) or die(mysqli_error($this->db));
     header("Location: ../index");
 }
开发者ID:KoichiTakashiro,项目名称:geechscamp,代码行数:7,代码来源:blogs_controller.php

示例2: delete

 public function delete($id)
 {
     $Blog = new Blog($this->table_name, $this->action);
     $sql = $Blog->destroy($id);
     mysqli_query($this->db, $sql) or die(mysqli_error($this->db));
     header("Location: ../index");
 }
开发者ID:amico8,项目名称:seed_framework,代码行数:7,代码来源:blogs_controller.php

示例3: deleteAction

 public function deleteAction()
 {
     // make sure they own it
     $Blog = new Blog($this->_db, new User($this->_db, $_SESSION['user']['id']));
     $post = $Blog->find(array('id' => abs($_GET['id'])));
     if (empty($post[0]) || $post[0]['users_id'] != $_SESSION['user']['id']) {
         $this->_template->hud = array('class' => 'error', 'message' => 'You do not own this post!');
         return false;
     }
     if ($Blog->destroy($_GET['id'])) {
         $this->forward('index', array('class' => 'success', 'message' => 'The post was removed!'));
     } else {
         $this->_template->hud = array('class' => 'error', 'message' => 'There was a problem removing the post!');
     }
 }
开发者ID:bamcod,项目名称:PubCodeHub,代码行数:15,代码来源:manageController.php


注:本文中的Blog::destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。