本文整理汇总了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);
}
示例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())]);
}
示例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]);
}
示例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'));
}
示例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));
}
示例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()]);
}
示例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
}
示例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]);
}
示例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]);
}
示例10: index
/**
* Display a listing of the resource.
*/
public function index()
{
return json()->withPagination(\App\Article::paginate(5), new ArticleTransformer());
}
示例11: index
public function index()
{
$articles = Article::paginate(5);
$articles->setPath('articles/');
return view('article.index', compact('articles'));
}
示例12: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$articles = Article::paginate(3);
return view('AdminHome')->withArticles($articles);
}
示例13: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$article = Article::paginate(5);
return view('articles.index', compact('article'));
}
示例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'));
}
示例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]);
}