本文整理汇总了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']);
}
}
示例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']);
}
}
}