本文整理汇总了PHP中app\News::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP News::paginate方法的具体用法?PHP News::paginate怎么用?PHP News::paginate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\News
的用法示例。
在下文中一共展示了News::paginate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index(Request $request)
{
if ($request->input('tag') == '全部动态' || $request->input('tag') == null) {
return view('news.index')->withNavSelection(3)->withTagSelection("全部动态")->withNews(News::paginate(10));
} else {
return view('news.index')->withNavSelection(3)->withTagSelection($request->input('tag'))->withNews(News::where('tag', $request->input('tag'))->paginate(10));
}
}
示例2: index
public function index(Request $request)
{
$tag = $request->input('tag');
if ($tag == null || $tag == "全部分类") {
return view('admin.news.index')->withNews(News::paginate(10))->withTag($tag);
} else {
return view('admin.news.index')->withNews(News::where('tag', $tag)->paginate(10))->withTag($tag);
}
}
示例3: index
public function index()
{
$news = News::all();
$news = News::paginate(3);
return View::make('admin.admin-editor')->with('news', $news);
}
示例4: newsPage
/**
* Fungsi buat tampilin semua data News
*/
public function newsPage()
{
$news = News::paginate(2);
$tipe = Type::all();
return view('FrontEnd.news', compact('news', 'tipe'));
}
示例5: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Model $objects)
{
$objects_for_filter = Model::all();
return view('admin.news.list', ['objects' => $objects->paginate(10), 'objects_for_filter' => $objects_for_filter]);
}