當前位置: 首頁>>代碼示例>>PHP>>正文


PHP categories::delete方法代碼示例

本文整理匯總了PHP中categories::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP categories::delete方法的具體用法?PHP categories::delete怎麽用?PHP categories::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在categories的用法示例。


在下文中一共展示了categories::delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: json_encode

<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
define('USING_LANGUAGE', false);
require_once '../../../config.php';
require_once $config['root_path'] . '/core/functions.php';
include_once $config['system_core'] . "/initEngine.php";
admin_login();
if (isset($_POST['delete']) && isset($_POST['id']) && isset($_SESSION['user']['access']['categories'])) {
    require_once ROOT_PATH . "/apps/categories/models/categories.class.php";
    $cms = new categories();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
}
echo json_encode(array_merge($_POST, array('status' => 'unknown error')));
die;
開發者ID:yunsite,項目名稱:demila,代碼行數:24,代碼來源:delete.php

示例2: header

<?php

if (!isset($_SESSION['admin'])) {
    header('location: Login');
    die;
}
require 'classes/class_categories.php';
$categories = new categories();
// If there are a request to save the categories
if (isset($_POST['save_categories_submit'])) {
    // Saving the categories
    if (isset($_POST['categories'])) {
        $categories->save($_POST['categories']);
    }
    // Adding new category, if admin fill one
    $checked = isset($_POST['checked']) ? 1 : 0;
    if (isset($_POST['name']) && isset($_POST['order']) && !empty($_POST['name']) && !empty($_POST['order'])) {
        $categories->add($_POST['name'], $_POST['order'], $checked);
    }
}
// If there are a request to delete category
if (isset($_GET['d'])) {
    $categories->delete($_GET['d']);
}
// Gets all the categories in array
$categories->get();
require 'design/design_categories.php';
開發者ID:noamh,項目名稱:Boomboom,代碼行數:27,代碼來源:engine_categories.php


注:本文中的categories::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。