本文整理汇总了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();
}
示例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;
}
}
示例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');
}
示例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");
}
}
示例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");
}
}
}
示例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!";
}
}
示例7: update
public function update($id, $title, $body)
{
//モデル呼び出し
$blog = new Blog();
$this->editOption = $blog->update($id, $title, $body);
header('Location: /seed_blog/blogs/index');
}
示例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];
}
}
示例9: update
public function update($id, $post)
{
$blog = new Blog();
$blog->update($id, $post);
// indexへ遷移
header('Location: /seed_blog/blogs/index/');
}