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


PHP Pager::delete方法代碼示例

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


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

示例1: delete

 public function delete()
 {
     $hash_Str = $this->input->get('hash');
     $pagerid_Num = $this->input->get('pagerid');
     $pagerid_Arr = $this->input->post('pagerid_Arr[]');
     if (empty($pagerid_Arr) && empty($pagerid_Num)) {
         $this->load->model('Message');
         $this->Message->show(['message' => '未選擇要刪除的動態頁麵', 'url' => 'admin/base/pager/pager/tablelist']);
     }
     //CSRF過濾
     if ($hash_Str == $this->security->get_csrf_hash()) {
         if (!empty($pagerid_Num)) {
             $Pager = new Pager(['pagerid_Num' => $pagerid_Num]);
             $Pager->delete();
         }
         if (!empty($pagerid_Arr)) {
             foreach ($pagerid_Arr as $key => $value_pager) {
                 $Pager = new Pager(['pagerid_Num' => $value_pager]);
                 $Pager->delete();
             }
         }
         $this->load->model('Message');
         $this->Message->show(['message' => '刪除成功', 'url' => 'admin/base/pager/pager/tablelist']);
     } else {
         $this->load->model('Message');
         $this->Message->show(['message' => 'hash驗證失敗,請使用標準瀏覽器進行刪除動作', 'url' => 'admin/base/pager/pager/tablelist']);
     }
 }
開發者ID:fansWoo,項目名稱:win_the_world,代碼行數:28,代碼來源:Pager.php

示例2: Pager

along with Affiliates For All.  If not, see
<http://www.gnu.org/licenses/>.
*/
$admin_required = TRUE;
require_once '../lib/bootstrap.php';
Template::check_ajax_key();
$pager = new Pager('affiliates', Database::$affiliate_short_fields, Database::$affiliate_short_headings, Database::$affiliate_fields);
$pager->set_admin_mode();
$pager->set_editable();
$pager->set_order_by('local_username');
$pager->disable_date_restriction();
if ($_GET['format'] == 'json') {
    $pager->json($_GET['page']);
} else {
    if ($_GET['format'] == 'write') {
        // Don't let people lock themselves out of the administration screens:
        if ($_GET['key'] == 1) {
            $_GET['administrator'] = 1;
        }
        $pager->write($_GET);
    } else {
        if ($_GET['format'] == 'delete') {
            // Don't let people delete the Admin account:
            if ($_GET['key'] != 1) {
                $pager->delete($_GET['key']);
            }
        } else {
            $pager->json_single($_GET['key']);
        }
    }
}
開發者ID:JulioNavarro,項目名稱:Affiliates-For-All,代碼行數:31,代碼來源:json-admin-affiliates.php


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