当前位置: 首页>>代码示例>>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;未经允许,请勿转载。