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


PHP User::paginate方法代碼示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     if ($request->input('q')) {
     }
     $users = User::paginate(50);
     return view('admin.users.index', compact('users'));
 }
開發者ID:6akcuk,項目名稱:infotendermail,代碼行數:12,代碼來源:UsersController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Request::get('filter')) {
         $records = User::where('title', 'LIKE', '%' . Request::get('filter') . '%')->paginate(10);
     } else {
         $records = User::paginate(10);
     }
     return view('back.scope.system.users.index', compact('records'));
 }
開發者ID:jammersonf,項目名稱:skeleton,代碼行數:14,代碼來源:UsersController.php

示例3: index

 public function index($request, $response, $args)
 {
     $pageNum = 1;
     if (isset($request->getQueryParams()["page"])) {
         $pageNum = $request->getQueryParams()["page"];
     }
     $users = User::paginate(15, ['*'], 'page', $pageNum);
     $users->setPath('/admin/user');
     return $this->view()->assign('users', $users)->display('admin/user/index.tpl');
 }
開發者ID:holotr,項目名稱:ss-panel,代碼行數:10,代碼來源:UserController.php

示例4: getPaginated

 /**
  * Get a cached paginated result
  *
  * @param $perPage
  * @return mixed
  */
 public function getPaginated($perPage)
 {
     $page = Request::get('page');
     if (!$page) {
         $page = 0;
     }
     $cacheKey = 'laradmin_users_page' . $page;
     return Cache::tags('laradmin_users')->remember($cacheKey, 60, function () use($perPage) {
         return User::paginate($perPage);
     });
 }
開發者ID:Matth--,項目名稱:laradmin,代碼行數:17,代碼來源:UserRepository.php

示例5: index

 public function index(Request $request)
 {
     $users = User::paginate(10);
     $roles = DB::table('roles')->lists('role_name', 'id');
     $viewData = array('users' => $users, 'roles' => $roles);
     $userId = $request->get('id');
     $action = $request->get('action');
     if ($action == 'delete') {
         return $this->delete($userId);
     }
     if ($action == 'accept') {
         return $this->accept($userId);
     }
     if ($userId) {
         $user = User::find($userId);
         $viewData['user'] = $user;
     }
     return view('admin.user', $viewData);
 }
開發者ID:phamnhuson,項目名稱:VDNABARCODE,代碼行數:19,代碼來源:UserController.php

示例6: displayAdminPage

 /**
  * Show the admin panel, and process admin AJAX requests.
  *
  * @return Response
  */
 public function displayAdminPage(Request $request)
 {
     if (!$this->isLoggedIn()) {
         return abort(404);
     }
     $username = session('username');
     $role = session('role');
     $admin_users = null;
     $admin_links = null;
     if ($this->currIsAdmin()) {
         $admin_users = User::paginate(15);
         $admin_links = Link::paginate(15);
     }
     $user = UserHelper::getUserByUsername($username);
     if (!$user) {
         return redirect(route('index'))->with('error', 'Invalid or disabled account.');
     }
     $user_links = Link::where('creator', $username)->paginate(15);
     return view('admin', ['role' => $role, 'admin_users' => $admin_users, 'admin_links' => $admin_links, 'user_links' => $user_links, 'api_key' => $user->api_key, 'api_active' => $user->api_active, 'api_quota' => $user->api_quota]);
 }
開發者ID:rkubik,項目名稱:polr,代碼行數:25,代碼來源:AdminController.php

示例7: index

 /**
  * Index Page for this controller.
  *
  * Maps to the following URL
  * 		http://example.com/index.php/welcome
  *	- or -
  * 		http://example.com/index.php/welcome/index
  *	- or -
  * Since this controller is set as the default controller in
  * config/routes.php, it's displayed at http://example.com/
  *
  * So any other public methods not prefixed with an underscore will
  * map to /index.php/welcome/<method_name>
  *
  * @see https://codeigniter.com/user_guide/general/urls.html
  */
 public function index()
 {
     User::create(['name' => 'test' . uniqid(), 'email' => 'test' . uniqid() . '@test.com', 'password' => md5('test' . uniqid())]);
     $users = User::paginate(5);
     $this->output->set_output(View::make('users', compact('users')));
 }
開發者ID:recca0120,項目名稱:laraigniter,代碼行數:22,代碼來源:welcome.php

示例8: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = User::paginate(10);
     return view('admin.users.index', compact('users'));
 }
開發者ID:alfons83,項目名稱:tfg,代碼行數:10,代碼來源:UsersController.php

示例9: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return User::paginate(10);
 }
開發者ID:jsdecena,項目名稱:baseapp,代碼行數:9,代碼來源:UserApiController.php

示例10: getManage

 public function getManage()
 {
     $this->middleware('admin');
     $users = User::paginate(20);
     return view('admin.users.manage', ['pageInfo' => ['siteTitle' => 'Manage Users', 'pageHeading' => 'Manage Users', 'pageHeadingSlogan' => 'Here the section to manage all registered users'], 'data' => ['users' => $users]]);
 }
開發者ID:MehmetNuri,項目名稱:nahid.co,代碼行數:6,代碼來源:UsersController.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return view('admin.users.list', array('data' => User::paginate(10)));
 }
開發者ID:jsdecena,項目名稱:pkp,代碼行數:9,代碼來源:UsersController.php

示例12: listing

 public function listing($page, $limit)
 {
     $response = array('data' => array(), 'paginator' => '');
     if (!empty($limit)) {
         $users = User::paginate($limit);
     } else {
         $users = User::where('id', '>', '0')->get();
     }
     if (!empty($users)) {
         foreach ($users as $key => $user) {
             $response['data'][] = $this->get($user->id, false);
         }
     }
     if (!empty($limit)) {
         $response = Utility::paginator($response, $users, $limit);
     }
     return $response;
 }
開發者ID:iqbalmalik89,項目名稱:carpool,代碼行數:18,代碼來源:UserRepository.php

示例13: index

 /**
  * @api {get} /users 用戶列表
  * @apiDescription 當前用戶信息
  * @apiGroup user
  * @apiPermission none
  * @apiVersion 0.1.0
  * @apiSuccessExample {json} Success-Response:
  *     HTTP/1.1 200 OK
  *     {
  *       "data": [
  *         {
  *           "id": 2,
  *           "email": "490554191@qq.com",
  *           "name": "fff",
  *           "created_at": "2015-11-12 10:37:14",
  *           "updated_at": "2015-11-13 02:26:36",
  *           "deleted_at": null
  *         }
  *       ],
  *       "meta": {
  *         "pagination": {
  *           "total": 1,
  *           "count": 1,
  *           "per_page": 15,
  *           "current_page": 1,
  *           "total_pages": 1,
  *           "links": []
  *         }
  *       }
  *     }
  */
 public function index()
 {
     $users = User::paginate();
     return $this->response->paginator($users, new UserTransformer());
 }
開發者ID:Vagabondtq,項目名稱:lumen-api-demo,代碼行數:36,代碼來源:UsersController.php

示例14: index

 public function index()
 {
     $system_users = User::paginate(Config('constants.paginateNo'));
     $roles = Role::get(['id', 'name'])->toArray();
     return view(Config('constants.adminSystemUsersView') . '.index', compact('system_users', 'roles'));
 }
開發者ID:sushilcs111,項目名稱:sourcesunlimited,代碼行數:6,代碼來源:SystemUsersController.php

示例15: users

 public function users()
 {
     $users = User::paginate(10);
     return view('users', array('users' => $users));
 }
開發者ID:lukasztaras,項目名稱:polblog,代碼行數:5,代碼來源:HomeController.php


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