コード例 #1
0
 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
0
 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
0
ファイル: NewsController.php プロジェクト: ResidentSleep/site
 public function index()
 {
     $news = News::all();
     $news = News::paginate(3);
     return View::make('admin.admin-editor')->with('news', $news);
 }
コード例 #4
0
 /**
  * Fungsi buat tampilin semua data News
  */
 public function newsPage()
 {
     $news = News::paginate(2);
     $tipe = Type::all();
     return view('FrontEnd.news', compact('news', 'tipe'));
 }
コード例 #5
0
 /**
  * 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]);
 }