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


PHP Category::get方法代码示例

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


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

示例1: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     //获取商品类型
     $type_list = Type::all();
     //获取商品分类
     $categoryData = Category::get();
     $cate_list = getTree($categoryData);
     return view('admin.goods.create', compact('type_list', 'cate_list'));
 }
开发者ID:Jokeramc,项目名称:amc,代码行数:14,代码来源:GoodController.php

示例2: edit

 /**
  * edit data page
  * @param int id
  * @return view
  */
 public function edit($id)
 {
     $categoryData = Category::get();
     $ids = getChild($categoryData, $id);
     $ids[] = $id;
     $category = getTree($categoryData);
     $info = Category::findOrFail($id);
     return view('admin.category.edit', compact('ids', 'category', 'info'));
 }
开发者ID:Jokeramc,项目名称:amc,代码行数:14,代码来源:CategoryController.php

示例3: sidebarCategory

 protected function sidebarCategory()
 {
     if (!Cache::has('_tags')) {
         $tags = Tagged::join('tags', 'tagged.tag_id', '=', 'tags.id')->select('tags.id', DB::raw('count(tag_id) as total_tags'), 'tags.tag_name')->groupBy('tagged.tag_id')->take(20)->get();
         Cache::put('_tags', $tags, 60);
     }
     if (!Cache::has('_category')) {
         $category = Category::get();
         Cache::put('_category', $category, 60);
     }
     if (!Cache::has('_recent')) {
         $recent = Diary::where('status', 1)->orderBy('created_at', 'desc')->take(5)->get(['title', 'id']);
         Cache::put('_recent', $recent, 60);
     }
     view()->composer('site.partials.sidebar', function ($view) {
         $view->with('navData', ['category' => Cache::get('_category'), 'recents' => Cache::get('_recent'), 'tags' => Cache::get('_tags')]);
     });
 }
开发者ID:MehmetNuri,项目名称:nahid.co,代码行数:18,代码来源:PartialServiceProvider.php

示例4: create

 public function create()
 {
     $categories = Category::get()->lists('title', 'id');
     return view('news.create', ['categories' => $categories]);
 }
开发者ID:lyovkin,项目名称:v2board,代码行数:5,代码来源:NewsController.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return Category::get();
 }
开发者ID:nq2916,项目名称:savings,代码行数:9,代码来源:CategoryController.php

示例6: category

 public function category($category)
 {
     $category = models\Category::get($category);
     $messages = Session::messages();
     return $this->tpl->display(__METHOD__, get_defined_vars());
 }
开发者ID:rudiedirkx,项目名称:Rudie-on-wheels,代码行数:6,代码来源:blogController.php

示例7: getEdit

 public function getEdit($id)
 {
     $cat = Category::get();
     $diary = Diary::find($id);
     return view('admin.diary.editdiary', ['pageInfo' => ['siteTitle' => 'Edit Diary', 'pageHeading' => 'Edit Diary', 'pageHeadingSlogan' => 'I write here what I learn'], 'data' => ['category' => $cat, 'diary' => $diary]]);
 }
开发者ID:MehmetNuri,项目名称:nahid.co,代码行数:6,代码来源:DiaryController.php

示例8: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $data = Category::get();
     return response()->json($data);
 }
开发者ID:cookies5127,项目名称:cookiesblog,代码行数:10,代码来源:CategoryController.php

示例9: listCategory

 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function listCategory()
 {
     return view('admin.partials.list_category', ['categories' => Category::get()]);
 }
开发者ID:nandha007,项目名称:tnbooks.in,代码行数:9,代码来源:AdminController.php


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