当前位置: 首页>>代码示例>>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;未经允许,请勿转载。