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