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


PHP Branch::like方法代碼示例

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


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

示例1: index

 public function index($offset = 0)
 {
     $this->filter_access('Branch', 'roled_select', base_url());
     $branch_list = new Branch();
     switch ($this->input->get('c')) {
         case "1":
             $data['col'] = "branch_name";
             break;
         case "2":
             $data['col'] = "branch_id";
             break;
         default:
             $data['col'] = "branch_id";
     }
     if ($this->input->get('d') == "1") {
         $data['dir'] = "DESC";
     } else {
         $data['dir'] = "ASC";
     }
     $data['title'] = "Branch";
     $data['btn_add'] = anchor('branches/add', 'Add New', "class='btn btn-primary'");
     $data['btn_home'] = anchor(base_url(), 'Home', "class='btn btn-home'");
     $uri_segment = 3;
     $offset = $this->uri->segment($uri_segment);
     if ($this->input->get('search_by')) {
         $total_rows = $branch_list->like($_GET['search_by'], $_GET['q'])->count();
         $branch_list->like($_GET['search_by'], $_GET['q'])->order_by($data['col'], $data['dir']);
     } else {
         $total_rows = $branch_list->count();
         $branch_list->order_by($data['col'], $data['dir']);
     }
     $data['branch_list'] = $branch_list->get($this->limit, $offset)->all;
     $config['base_url'] = site_url("branches/index");
     $config['total_rows'] = $total_rows;
     $config['per_page'] = $this->limit;
     $config['uri_segment'] = $uri_segment;
     $this->pagination->initialize($config);
     $data['pagination'] = $this->pagination->create_links();
     $this->load->view('branches/index', $data);
 }
開發者ID:anggadjava,項目名稱:payroll,代碼行數:40,代碼來源:branches.php


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