当前位置: 首页>>代码示例>>PHP>>正文


PHP Category::getSortedCategories方法代码示例

本文整理汇总了PHP中app\Category::getSortedCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::getSortedCategories方法的具体用法?PHP Category::getSortedCategories怎么用?PHP Category::getSortedCategories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Category的用法示例。


在下文中一共展示了Category::getSortedCategories方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //        $num_per_page=env('num_per_page_admin');
     //        $categories = Category::getSortedCategories()->paginate($num_per_page);
     //pagination are not possible with getSortedCategories...
     $categories = Category::getSortedCategories();
     return view('admin.cats.index', compact('categories'));
 }
开发者ID:ambarsetyawan,项目名称:laravel5-blog-1,代码行数:13,代码来源:CategoriesController.php

示例2: composeSidebar

 private function composeSidebar()
 {
     view()->composer('home.partials.sidebar', function ($view) {
         $allTags = \App\Tag::all();
         $allCategories = \App\Category::getSortedCategories();
         $NewestArticles = \App\Article::latest()->take(15)->get();
         $hottestArticles = \App\Article::orderBy('click')->take(15)->get();
         $view->with(compact('allTags', 'allCategories', 'NewestArticles', 'hottestArticles'));
     });
 }
开发者ID:kpaxer,项目名称:laravel-blog,代码行数:10,代码来源:ViewComposerServiceProvider.php

示例3: composeSidebar

 private function composeSidebar()
 {
     view()->composer('blog.partials.side', function ($view) {
         $allCategories = \App\Category::getSortedCategories();
         $NewestArticles = \App\Article::published()->orderBy('updated_at', 'desc')->take(10)->get();
         $view->with(compact('allCategories', 'NewestArticles'));
     });
     view()->composer('home.partials.side', function ($view) {
         $NewestArticles = \App\Article::published()->orderBy('updated_at', 'desc')->take(10)->get();
         $view->with(compact('NewestArticles'));
     });
 }
开发者ID:ambarsetyawan,项目名称:laravel5-blog-1,代码行数:12,代码来源:ViewComposerServiceProvider.php

示例4: index

 public function index()
 {
     $categories = Category::getSortedCategories();
     return view('admin.categories.index', compact('categories'));
 }
开发者ID:hushibing,项目名称:laravel51,代码行数:5,代码来源:CategoryController.php

示例5: categories

 public function categories()
 {
     return Category::getSortedCategories();
 }
开发者ID:hushibing,项目名称:laravel51,代码行数:4,代码来源:BaseController.php


注:本文中的app\Category::getSortedCategories方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。