當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Category::paginate方法代碼示例

本文整理匯總了PHP中app\Category::paginate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Category::paginate方法的具體用法?PHP Category::paginate怎麽用?PHP Category::paginate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Category的用法示例。


在下文中一共展示了Category::paginate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $categories = Category::paginate();
     $categories->setPath(route('categories.index'));
     //dd($categories);
     return view("categories.lista", compact('categories'));
 }
開發者ID:serranozafra,項目名稱:pruebaHectorSerrano,代碼行數:12,代碼來源:CategoryController.php

示例2: categories

 public function categories()
 {
     $view = Input::get('view');
     if ($view == null) {
         return redirect('/admin/categories?view=hierarchy');
     }
     $levels = ['Main Category', 'Subcategory', 'Post Sub Category'];
     $types = ['main-categories', 'sub-categories', 'post-sub-categories'];
     $views = ['Hierarchy', 'Type', 'All'];
     $cats = Category::roots()->get();
     $category = Input::get('category');
     $_category = Category::find($category);
     if ($view == 'type') {
         $type = Input::get('type');
         if ($type == null) {
             $type = $types[0];
         }
         // array_keys() = get keys from value
         // appends() = add 'get' variables (to url)
         $cats = Category::whereDepth(array_keys($types, $type))->paginate(25)->appends(Input::except('page'));
     } else {
         if ($view == 'all') {
             $cats = Category::paginate(25)->appends(Input::except('page'));
         }
     }
     return view('admin.main')->with('category', $_category)->with('cats', $cats)->with('levels', $levels)->with('view', $view)->with('views', $views)->with('types', $types);
     // only for 'type' view
 }
開發者ID:bluecipherz,項目名稱:gl-ct,代碼行數:28,代碼來源:AdminPanelController.php

示例3: categories

 /**
  * Show user categories.
  * @return Response
  */
 public function categories()
 {
     if ($this->user->categories()->count() > 0) {
         $categories = $this->user->categories()->paginate(10);
     } else {
         $categories = Category::paginate(10);
     }
     return view('pages.categories', compact('categories'));
 }
開發者ID:hootlex,項目名稱:apodeiksi,代碼行數:13,代碼來源:PagesController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //$categories = Category::orderBy('name')->get();;
     $categories = Category::paginate(5);
     return view('admin.categories.index', compact('categories'));
     //Regresar la variable categories a la vista con todos los datos
     // return \View::make('categories.index')
     //     ->with('categories', Category::all());
 }
開發者ID:edgarxene,項目名稱:ClothingStore,代碼行數:14,代碼來源:CategoriesController.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $results = ['columns' => [['編號', 'id'], ['分類名', 'name'], ['創建時間', 'created_at'], ['更新時間', 'updated_at'], ['操作', 'buttons', function ($data) {
         $buttons = [['查看'], ['編輯']];
         return $buttons;
     }]]];
     $paginate = Category::paginate();
     $results['items'] = $paginate;
     return $this->view(self::URI . '.index', compact('results'));
 }
開發者ID:abcsun,項目名稱:ForoneAdminDemo,代碼行數:15,代碼來源:CategoryController.php

示例6: index

 public function index()
 {
     $categories = Category::paginate(5);
     return view('admin.category.index', compact('categories'));
 }
開發者ID:namnv609,項目名稱:tunv-laravel5-tutorial,代碼行數:5,代碼來源:CategoriesController.php

示例7: category

 public function category(Request $request)
 {
     $category = Category::paginate(15);
     return view('admin.category.index', compact('category'));
 }
開發者ID:sbrojdenov,項目名稱:shop,代碼行數:5,代碼來源:CategoryController.php

示例8: index

 /**
  * Display a listing of the resource.
  * @param Request $request
  * @return Response
  * @internal param
  */
 public function index(Request $request)
 {
     $limit = $request->input('limit') ?: 3;
     $categories = Category::paginate($limit);
     return $this->respondWithPagination($categories, ['data' => $this->categoryTransformer->transformCollection($categories->all())]);
 }
開發者ID:alons182,項目名稱:guanacastevende,代碼行數:12,代碼來源:CategoriesController.php

示例9: index

 public function index()
 {
     $categories = Category::paginate();
     return view('category/category-list')->with('categories', $categories);
 }
開發者ID:leloulight,項目名稱:paschalinotech,代碼行數:5,代碼來源:CategoryController.php

示例10: categories

 public function categories()
 {
     $categories = Category::paginate(20);
     return View('admin.categories', compact('categories'));
 }
開發者ID:FRKodes,項目名稱:ekonexion,代碼行數:5,代碼來源:AdminController.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $category = Category::paginate(5);
     return view('categories.index', compact('category'));
 }
開發者ID:hoangvu2015,項目名稱:laravel_totnghiep,代碼行數:10,代碼來源:CategoryController.php

示例12: getIndex

 public function getIndex()
 {
     $categories = Category::paginate(5);
     $title = 'Categories Listing';
     return view('category.index', compact('categories', 'title'));
 }
開發者ID:imladrisol,項目名稱:onlineExam,代碼行數:6,代碼來源:CategoryController.php

示例13: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $categories = Category::paginate(15);
     return View('admin.categories.category')->with('categories', $categories);
 }
開發者ID:TEACHER-KEAK,項目名稱:GAD,代碼行數:10,代碼來源:CategoryController.php

示例14: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $category = Category::paginate(20);
     return view('category-list')->with('category', $category);
 }
開發者ID:nazieb,項目名稱:Kurio-Final-Test,代碼行數:10,代碼來源:CategoryController.php

示例15: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $categories = Category::paginate(30);
     return View('categories.index', compact('categories'));
 }
開發者ID:amolkattel,項目名稱:Asset-Mgnt-Project,代碼行數:10,代碼來源:CategoriesController.php


注:本文中的app\Category::paginate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。