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


PHP Role::order_by方法代碼示例

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


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

示例1: dropdown

 public static function dropdown()
 {
     $roles = array();
     foreach (Role::order_by('name', 'asc')->get() as $role) {
         $roles[$role->id] = $role->name;
     }
     return $roles;
 }
開發者ID:neosin,項目名稱:tinyissue,代碼行數:8,代碼來源:role.php

示例2: get_index

 public function get_index()
 {
     $this->data[$this->views] = Role::order_by('id', 'asc')->get();
     return View::make('themes.modul.' . $this->views . '.index', $this->data);
 }
開發者ID:acmadi,項目名稱:diantaksi,代碼行數:5,代碼來源:roles.php

示例3: get_index

 public function get_index()
 {
     //        $this->data[$this->views] = Role::order_by('id', 'asc')->get();
     $this->data[$this->views] = Role::order_by('id', 'asc')->paginate(PER_PAGE_MEDIUM);
     return View::make('admin.' . $this->views . '.index', $this->data);
 }
開發者ID:rmachuca89,項目名稱:tests,代碼行數:6,代碼來源:roles.php

示例4: get_index

 public function get_index()
 {
     return $this->layout->with('active', 'dashboard')->nest('content', 'administration.users.index', array('roles' => Role::order_by('id', 'DESC')->get()));
 }
開發者ID:niceit,項目名稱:tranit-tracker,代碼行數:4,代碼來源:users.php

示例5: get_index

 /**
  * Displays list of roles
  *
  * @return str
  */
 public function get_index()
 {
     $roles = Role::order_by('id', 'asc')->get();
     return View::make('gotin::roles', array('roles' => $roles, 'flash' => $this->flash, 'active' => 'roles', 'b_links' => array("Roles")));
 }
開發者ID:SerdarSanri,項目名稱:gotin,代碼行數:10,代碼來源:roles.php

示例6: roles

 function roles()
 {
     $role = new Role();
     $total_rows = $role->count();
     switch ($this->input->get('c')) {
         case "1":
             $data['col'] = "role_name";
             break;
         case "2":
             $data['col'] = "role_id";
             break;
         default:
             $data['col'] = "role_id";
     }
     if ($this->input->get('d') == "1") {
         $data['dir'] = "DESC";
     } else {
         $data['dir'] = "ASC";
     }
     $data['title'] = "Roles";
     $data['btn_add'] = anchor('users/add_role', '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);
     $role->order_by($data['col'], $data['dir']);
     $data['role_list'] = $role->get($this->limit, $offset)->all;
     $config['base_url'] = site_url("users/roles");
     $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('users/index_roles', $data);
 }
開發者ID:anggadjava,項目名稱:payroll,代碼行數:34,代碼來源:users.php


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