本文整理汇总了PHP中Blog::deleteBlog方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::deleteBlog方法的具体用法?PHP Blog::deleteBlog怎么用?PHP Blog::deleteBlog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blog
的用法示例。
在下文中一共展示了Blog::deleteBlog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteBlog
function deleteBlog()
{
$blog = new Blog();
$blog->deleteBlog($_POST['blogId']);
}
示例2: actionDelete
public static function actionDelete($id)
{
if (isset($_POST['submit'])) {
$result = Blog::deleteBlog($id);
if (!$result) {
$_SESSION['message'] = "Произошла ошибка при удалении блога.";
}
FunctionLibrary::redirectTo('/admin/blog');
}
return true;
}
示例3: Blog
require_once "../../include/common.php";
require_once "../include/config.php";
// Create blog object
$blog = new Blog(!empty($_GET["blogId"]) ? $_GET["blogId"] : "");
// Determine if user has permission to edit blog
if (!$blog->hasAdministerPermission()) {
$login->printLoginForm();
exit;
}
// Include language
include scriptPath . "/" . folderBlog . "/include/language/" . (!empty($blog->id) ? $blog->language : pageLanguage) . "/general.php";
// Insert, update or delete blog
if (!empty($_GET["save"])) {
if (!empty($_POST["deleteBlog"])) {
// Delete blog
$blog->deleteBlog();
// Redirect to blog index
redirect(scriptUrl . "/" . folderBlog . "/" . fileBlogIndex);
} else {
// Save blog data
$errors = $blog->saveBlog();
// Redirect
if (!$errors->hasErrors()) {
redirect(!empty($_POST["referer"]) ? trim($_POST["referer"]) : scriptUrl . "/" . folderBlog . "/" . fileBlog . "?blogId=" . $blog->id);
}
}
}
// Generate navigation info */
$navigation[0][0] = scriptUrl . "/" . folderBlog;
$navigation[0][1] = "Blogs";
if (!empty($blog->id)) {