当前位置: 首页>>代码示例>>PHP>>正文


PHP Article::paginate方法代码示例

本文整理汇总了PHP中app\Article::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP Article::paginate方法的具体用法?PHP Article::paginate怎么用?PHP Article::paginate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Article的用法示例。


在下文中一共展示了Article::paginate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPaginated

 public function getPaginated(array $params)
 {
     if ($params['sortBy'] || $params['order']) {
         return Article::orderBy($params['sortBy'], $params['order'])->paginate(10);
     }
     return Article::paginate(10);
 }
开发者ID:myleshyson,项目名称:ivgainesville,代码行数:7,代码来源:PostsRepo.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $limit = \Input::get('limit') ?: 7;
     $articles = Article::paginate($limit);
     //dd(get_class_methods($articles));
     return $this->responseWithPagination($articles, ['data' => $this->articleTransformer->transformCollection($articles->all())]);
 }
开发者ID:rankarpan,项目名称:laravel-user-timezone,代码行数:12,代码来源:ArticleController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //$data = DB::table('article')->get();
     $data = Article::paginate(3);
     //var_dump($data);die;
     return view('fontend.examples.index', ['data' => $data]);
 }
开发者ID:qhorse,项目名称:casencms,代码行数:12,代码来源:ExamplesController.php

示例4: index

 public function index()
 {
     $articles = Article::paginate(PAGINATE);
     $categories = Category::all();
     $cate_id = -1;
     return view('admin.articles.index')->with(compact('articles', 'categories', 'cate_id'));
 }
开发者ID:louisthaihv,项目名称:colong,代码行数:7,代码来源:ArticleController.php

示例5: showArticles

 public function showArticles()
 {
     $articles = Article::paginate(5);
     if (Request::ajax()) {
         return Response::json(View::make('admin.article.articles', array('articles' => $articles))->render());
     }
     return View::make('admin.article.index', array('articles' => $articles));
 }
开发者ID:quangtruong16994,项目名称:laravel,代码行数:8,代码来源:ArticleController.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $Article = new Article();
     $rslist = $Article->paginate(10);
     $rslist->setPath("article");
     $pages = new BootstrapThreePresenter($rslist);
     return view("Admin/article/list")->with(["pages" => $pages, "rslist" => $rslist->toArray()]);
 }
开发者ID:such0322,项目名称:mylaravel,代码行数:13,代码来源:ArticleController.php

示例7: index

 public function index()
 {
     // Tao bien de lay du lieu
     //$articles = Article::All(); Ham nay lay toan bo du lieu va show len
     //
     // Tuy nhien nen viet nhu ben duoi de thuc hien phan trang
     $articles = Article::paginate(4);
     return view('articles.index', compact('articles'));
     // Trong Controller sau khi xu ly lay du lieu tu Model
     // sau do tra ve cho 1 view ten index de hien ra
 }
开发者ID:qtrung1305,项目名称:simple-blog,代码行数:11,代码来源:ArticleController.php

示例8: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     //		return view('articles.index')->withArticles(Article::paginate(2));
     //		$articles = Article::simplePaginate(2);
     $articles = Article::paginate(2);
     //		$articles->setPath('/articles');
     //		$articles->appends(['sort' => 'votes']);
     //		$articles->fragment('foo');
     return view('articles.index', ['articles' => $articles]);
 }
开发者ID:jason-gao,项目名称:xuelaravel,代码行数:16,代码来源:ArticlesController.php

示例9: showArticles

 public function showArticles()
 {
     $articles = Article::paginate(2);
     if (Auth::check()) {
         $user = Auth::user();
         $userid = $user->id;
         $articles->theuser = $userid;
     } else {
         $articles->theuser = 0;
     }
     return view('layouts.articles', ['articles' => $articles]);
 }
开发者ID:exDron,项目名称:AndrewBlog,代码行数:12,代码来源:ArticleController.php

示例10: index

 /**
  * Display a listing of the resource.
  */
 public function index()
 {
     return json()->withPagination(\App\Article::paginate(5), new ArticleTransformer());
 }
开发者ID:hongpyo,项目名称:l5essential,代码行数:7,代码来源:ArticlesController.php

示例11: index

 public function index()
 {
     $articles = Article::paginate(5);
     $articles->setPath('articles/');
     return view('article.index', compact('articles'));
 }
开发者ID:bee7er,项目名称:brianetheridge_laravel_v2,代码行数:6,代码来源:ArticlesController.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $articles = Article::paginate(3);
     return view('AdminHome')->withArticles($articles);
 }
开发者ID:babyanzichen,项目名称:laravel5,代码行数:10,代码来源:AdminHomeController.php

示例13: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $article = Article::paginate(5);
     return view('articles.index', compact('article'));
 }
开发者ID:hoangvu2015,项目名称:laravel_totnghiep,代码行数:10,代码来源:ArticleController.php

示例14: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     pagetitle([trans('news.index'), settings('server_name')]);
     $articles = Article::paginate();
     return view('admin.news.view', compact('articles'));
 }
开发者ID:huludini,项目名称:aura-kingdom-web,代码行数:11,代码来源:NewsController.php

示例15: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data = Article::paginate(15);
     //$data = DB::table('article')->get();
     return view('backend.article.index', ['data' => $data]);
 }
开发者ID:qhorse,项目名称:casencms,代码行数:11,代码来源:ArticleController.php


注:本文中的app\Article::paginate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。