本文整理匯總了PHP中category::deleteCategory方法的典型用法代碼示例。如果您正苦於以下問題:PHP category::deleteCategory方法的具體用法?PHP category::deleteCategory怎麽用?PHP category::deleteCategory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類category
的用法示例。
在下文中一共展示了category::deleteCategory方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: printCategories
function printCategories($get_list)
{
$categ = new category();
if (isset($_GET['act']) && $_GET['act'] == "del") {
$status = $categ->deleteCategory($_GET['cid']);
header("location: categories.php?msg=" . $status);
}
if (isset($_GET['msg'])) {
echo '<span style="color:blue;">' . $_GET['msg'] . '</span>';
}
echo '<p><a href="edit_category.php">new category</a></p><br/>';
echo '<table cellspacing="0" cellpadding="0" border="1">';
echo '<tr><td>Category Name</td><td colspan="2"></td></tr>';
echo $get_list;
echo "</table>";
}
示例2: deleteCategory
public function deleteCategory(Request $data)
{
$userid = Auth::user()->id;
if ($data->isMethod('post')) {
$categoryid = $data->input('deletecategoryid');
$objCategory = new category();
$result = $objCategory->deleteCategory($categoryid);
// die($result);
if ($result) {
return redirect('/admin/category');
} else {
return redirect('/admin/category')->withErrors(['errMsg' => 'Error in Delete']);
}
}
}