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


PHP Blog::update方法代码示例

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


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

示例1: testOnBootstrap

 /**
  * Test
  *
  * @return void
  */
 public function testOnBootstrap()
 {
     $this->assertTrue($this->object->install());
     $this->assertTrue($this->object->update('0.1.0'));
     $this->assertNull($this->object->onBootstrap(Registry::get('Application')->getMvcEvent()));
     $this->assertTrue($this->object->uninstall());
     StaticEventManager::resetInstance();
 }
开发者ID:gotcms,项目名称:gotcms,代码行数:13,代码来源:ModuleTest.php

示例2: edit

 public function edit($blog, $id)
 {
     if (!empty($blog)) {
         $Blog = new Blog($this->plural_resorce, $this->option, $this->db);
         $sql = $Blog->update($blog, $id);
         mysqli_query($this->db, $sql) or die(mysqli_error($this->db));
         header('Location:../index');
         exit;
     }
 }
开发者ID:hiroki0325,项目名称:geechscamp,代码行数:10,代码来源:blogs_contllorer.php

示例3: update

 public function update()
 {
     $blog = new Blog(_post('blog'));
     $blog->trim();
     if (!$blog->validate_update()) {
         $this->flash->add('message_error', $blog->errors->get_messages());
         $this->back();
     }
     $blog->update();
     $this->redirect_to('/blog/index');
 }
开发者ID:utumdol,项目名称:codeseed,代码行数:11,代码来源:blog_controller.class.php

示例4: edit

 public function edit($id, $blog)
 {
     if (empty($blog)) {
         // ページに初めて訪れた際
         $blog_record = $this->show($id);
         $blog = mysqli_fetch_assoc($blog_record);
         return $blog;
     } elseif (!empty($blog)) {
         // 情報を編集し送信した際
         $id = array('id' => $id);
         $blog = array_merge($id, $blog);
         $Blog = new Blog($this->plural_resource);
         $sql = $Blog->update($blog);
         mysqli_query($this->db, $sql) or die(mysqli_error($this->db));
         header("Location: ../index");
     }
 }
开发者ID:KoichiTakashiro,项目名称:geechscamp,代码行数:17,代码来源:blogs_controller.php

示例5: edit

 public function edit($id)
 {
     if (empty($_POST)) {
         $blog_record = $this->show($id);
         $blog = mysqli_fetch_assoc($blog_record);
         return $blog;
     } else {
         if (!empty($_POST)) {
             $blog = $_POST;
             $id = array('id' => $id);
             $blog = array_merge($id, $blog);
             $Blog = new Blog($this->table_name, $this->action);
             $sql = $Blog->update($blog);
             mysqli_query($this->db, $sql) or die(mysqli_error($this->db));
             header("Location: ../index");
         }
     }
 }
开发者ID:amico8,项目名称:seed_framework,代码行数:18,代码来源:blogs_controller.php

示例6: Blog

 function update_photo()
 {
     include_once '/kunden/homepages/0/d643120834/htdocs/config/index.php';
     $config = new Blog();
     $res = $config->update('user_profiles', 'photo', $_POST['photo'], $_POST['user_name']);
     // print_r($res);
     if ($res == true) {
         echo "Profile Successfully Updated!";
     } else {
         echo "Something Went Wrong!";
     }
 }
开发者ID:mayoalexander,项目名称:fl-two,代码行数:12,代码来源:dashboard.php

示例7: update

 public function update($id, $title, $body)
 {
     //モデル呼び出し
     $blog = new Blog();
     $this->editOption = $blog->update($id, $title, $body);
     header('Location: /seed_blog/blogs/index');
 }
开发者ID:k-nish,项目名称:seed_blog,代码行数:7,代码来源:blogs_controller.php

示例8: updateAction

 public function updateAction()
 {
     if (empty($_GET['id'])) {
         return false;
     }
     $Blog = new Blog($this->_db, new User($this->_db, $_SESSION['user']['id']));
     $Blog->debug();
     // make sure they own the blog post
     $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 (!empty($_POST['submit'])) {
         $bind = array();
         foreach ($Blog->columns() as $key => $val) {
             if (isset($_POST[$val])) {
                 $bind[$val] = $_POST[$val];
             }
         }
         $bind['unixtime'] = time();
         if ($Blog->update($bind, abs($_GET['id']))) {
             $this->_template->hud = array('class' => 'success', 'message' => 'Post updated!');
         } else {
             $this->_template->hud = array('class' => 'error', 'message' => 'There was an error updating the post!');
         }
     }
     $post = $Blog->find(array('id' => abs($_GET['id'])));
     if (!empty($post[0])) {
         $this->_template->post = $post[0];
     }
 }
开发者ID:bamcod,项目名称:PubCodeHub,代码行数:32,代码来源:manageController.php

示例9: update

 public function update($id, $post)
 {
     $blog = new Blog();
     $blog->update($id, $post);
     // indexへ遷移
     header('Location: /seed_blog/blogs/index/');
 }
开发者ID:amico8,项目名称:seed_blog,代码行数:7,代码来源:blogs_controller.php


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