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


PHP Client::getDatatable方法代碼示例

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


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

示例1: postList

 public function postList($url_cat)
 {
     $check = $this->checkUrlCategory($url_cat);
     if (!$check) {
         return Redirect::route('admin.client', array('url_category' => 'entertainer'));
     }
     $search = array();
     $is_search = false;
     if (Input::get('sSearch', TRUE) != "") {
         $is_search = true;
         foreach ($this->col as $key) {
             if (isset($key['boolean']) and $key['unsearchable'] == false) {
                 if (strtolower(Input::get('sSearch', TRUE)) == 'yes') {
                     $search[$key['name']] = 1;
                 } else {
                     if (strtolower(Input::get('sSearch', TRUE)) == 'no') {
                         $search[$key['name']] = 0;
                     }
                 }
             } else {
                 if ($key['unsearchable'] == false) {
                     $search[$key['name']] = Input::get('sSearch', TRUE);
                 }
             }
             if ($key['type'] == 'ENTITY_DECODE') {
                 $search[$key['name']] = htmlentities(Input::get('sSearch', TRUE));
             }
         }
     }
     $options = array('iDisplayLength' => Input::get('iDisplayLength', TRUE), 'iDisplayStart' => Input::get('iDisplayStart', TRUE), 'sort_column' => Input::get('iSortCol_0', TRUE), 'sort_direction' => Input::get('sSortDir_0', TRUE), 'columns' => $this->col, 'sSearch' => $search, 'isSearch' => $is_search, 'filter' => Input::get('filter'));
     $rowset = Client::getDatatable($options);
     $aaData = array();
     foreach ($rowset['data'] as $row) {
         array_push($aaData, $row);
     }
     $cleanSet = json_decode(json_encode($aaData));
     $aaData = array();
     foreach ($cleanSet as $clean) {
         $cleanArr = get_object_vars($clean);
         $arr = array();
         foreach ($cleanArr as $data) {
             array_push($arr, $data);
         }
         array_push($arr, "");
         //to enable 1 extra column for Actions
         array_push($aaData, $arr);
     }
     $iTotalRecords = $rowset['total_data'];
     $iTotalDisplayRecords = $rowset['total_data'];
     $result = array("aaData" => $aaData, "iTotalRecords" => $iTotalRecords, "iTotalDisplayRecords" => $iTotalDisplayRecords);
     echo json_encode($result);
 }
開發者ID:benhanks040888,項目名稱:rmyrfl,代碼行數:52,代碼來源:ClientController.php


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