當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。