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


PHP Datatables::simple方法代碼示例

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


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

示例1: sessions_ajax

 function sessions_ajax()
 {
     if (!$this->input->is_ajax_request()) {
         exit('No direct script access allowed');
     } else {
         $table = '' . DBPREFIX . 'session';
         $primaryKey = 'id';
         $columns = array(array('db' => 'id', 'dt' => 'id'), array('db' => 'ip_address', 'dt' => 'ip_address'), array('db' => 'timestamp', 'dt' => 'timestamp'), array('db' => 'id', 'dt' => 'action', 'formatter' => function ($id) {
             return '<a href="' . base_url('' . $this->uri->segment(1) . '/sessions/delete/' . $id) . '" class="btn btn-danger btn-xs">Delete</a>';
         }));
         $sql_details = array('user' => $this->db->username, 'pass' => $this->db->password, 'db' => $this->db->database, 'host' => $this->db->hostname);
         $this->output->set_content_type('application/json')->set_output(json_encode(Datatables::simple($_GET, $sql_details, $table, $primaryKey, $columns), JSON_PRETTY_PRINT));
     }
 }
開發者ID:gaiius,項目名稱:SunQA,代碼行數:14,代碼來源:Dashboard.php

示例2: ajax

 function ajax()
 {
     if (!$this->input->is_ajax_request()) {
         exit('No direct script access allowed');
     } else {
         $table = '' . DBPREFIX . 'category';
         $primaryKey = 'id_category';
         $columns = array(array('db' => 'id_category', 'dt' => 'id_category'), array('db' => 'category_name', 'dt' => 'category_name'), array('db' => 'id_category', 'dt' => 'action', 'formatter' => function ($id) {
             return '<a href="' . base_url('' . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/view/' . $id) . '" target="_blank" class="btn btn-info btn-xs">View</a> <a href="' . base_url('' . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/update/' . $id) . '" class="btn btn-primary btn-xs">Update</a> <a href="' . base_url('' . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/delete/' . $id) . '" class="btn btn-danger btn-xs">Delete</a>';
         }));
         $sql_details = array('user' => $this->db->username, 'pass' => $this->db->password, 'db' => $this->db->database, 'host' => $this->db->hostname);
         $this->output->set_content_type('application/json')->set_output(json_encode(Datatables::simple($_GET, $sql_details, $table, $primaryKey, $columns), JSON_PRETTY_PRINT));
     }
 }
開發者ID:gaiius,項目名稱:SunQA,代碼行數:14,代碼來源:Category.php

示例3: ajax

 function ajax()
 {
     if (!$this->input->is_ajax_request()) {
         exit('No direct script access allowed');
     } else {
         $table = '' . DBPREFIX . 'session';
         $primaryKey = 'id';
         $columns = array(array('db' => 'id', 'dt' => 'id'), array('db' => 'ip_address', 'dt' => 'ip_address'), array('db' => 'timestamp', 'dt' => 'timestamp', 'formatter' => function ($str) {
             return dateHourIconPrivate(date('Y-m-d H:i:s', $str));
         }), array('db' => 'data', 'dt' => 'data', 'formatter' => function ($str) {
             return '<textarea style="margin: 0px;height: 150px;width: 350px;">' . preg_replace("/[s:]+[0-9]+[:]/", '', preg_replace("/^.+\n/", "", str_replace(';', "\n", str_replace('|', ' : ', $str)))) . '</textarea>';
         }), array('db' => 'id', 'dt' => 'action', 'formatter' => function ($id) {
             return '<a href="' . base_url('' . $this->uri->segment(1) . '/' . $this->uri->segment(2) . '/delete/' . $id) . '" class="btn btn-danger btn-xs">Delete</a>';
         }));
         $sql_details = array('user' => $this->db->username, 'pass' => $this->db->password, 'db' => $this->db->database, 'host' => $this->db->hostname);
         $this->output->set_content_type('application/json')->set_output(json_encode(Datatables::simple($_GET, $sql_details, $table, $primaryKey, $columns), JSON_PRETTY_PRINT));
     }
 }
開發者ID:gaiius,項目名稱:SunQA,代碼行數:18,代碼來源:Sessions.php


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