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


PHP Category::lists方法代码示例

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


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

示例1: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $categories = Category::lists('name', 'id');
     $merchants = Merchant::lists('name', 'id');
     $coupon = Coupon::find($id);
     return view('admin.coupon.update', compact('categories', 'merchants'))->with('coupon', $coupon);
 }
开发者ID:sientong,项目名称:tagin,代码行数:13,代码来源:CouponController.php

示例2: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $title = 'Update Category Information';
     $category = Category::findOrFail($id);
     $categories = Category::lists('title', 'id')->toArray();
     return view('private.category.edit', compact('title', 'category', 'categories'));
 }
开发者ID:git-mahfuz,项目名称:web-catalog,代码行数:13,代码来源:CategoryController.php

示例3: edit

 /**
  * Hiển thị form cho việc cập nhật bài viết.
  *
  * @param  Article  $article
  * @param ArticleRequest $request
  * @return Response
  */
 public function edit(Article $article)
 {
     // Lấy all Category & Tags để hiển thị
     $categories = Category::lists('name', 'id');
     $tags = Tag::lists('name', 'id')->toArray();
     return view('admin.articles.edit', compact('article', 'categories', 'tags'));
 }
开发者ID:khanhpnk,项目名称:hocvet,代码行数:14,代码来源:ArticleController.php

示例4: edit

 public function edit($id)
 {
     $countries = Country::orderBy('name', 'asc')->lists('name', 'id')->all();
     $categories = Category::lists('category', 'category')->all();
     $competition = Competition::whereId($id)->firstOrFail();
     return view('backend.competitions.edit', compact('competition', 'countries', 'categories'));
 }
开发者ID:steve8809,项目名称:pentathlon_2015,代码行数:7,代码来源:CompetitionsController.php

示例5: filterByCategory

 /**
  * Filter products by category
  *
  * @param $request
  * @return Response
  */
 public function filterByCategory(Request $request)
 {
     $title = 'Product Listing';
     $categories = Category::lists('title', 'id')->toArray();
     $products = Product::select(DB::raw("products.id, products.name, products.photo"))->leftJoin('category_product', 'category_product.product_id', '=', 'products.id')->whereIn('category_product.category_id', $request->input('category_id'))->groupBy('product_id')->paginate(10);
     return view('home', compact('title', 'categories', 'products'));
 }
开发者ID:git-mahfuz,项目名称:web-catalog,代码行数:13,代码来源:HomeController.php

示例6: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     //dd($id);
     $issues = Category::lists('title', 'id');
     $file = Book::findOrFail($id);
     return view('book.edit', compact('file', 'issues'));
 }
开发者ID:polodev,项目名称:Bard-Ftfl-Laravel-Project,代码行数:13,代码来源:BookController.php

示例7: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer(['products.partials.form', 'partials.nav', 'partials.sidebar'], function ($view) {
         $view->with('categories', Category::lists('name', 'id'));
         $view->with('manufacturers', Manufacturer::lists('name', 'id'));
     });
 }
开发者ID:slawisha,项目名称:computer-shop,代码行数:12,代码来源:ComposerServiceProvider.php

示例8: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $post = Post::findOrFail($id);
     $categories = Category::lists('name', 'id');
     $tags = Tag::lists('name', 'id');
     return view('posts.edit', compact('post', 'categories', 'tags'));
 }
开发者ID:alexisAvenel,项目名称:portfolioLaravel,代码行数:13,代码来源:PostsController.php

示例9: __construct

 public function __construct()
 {
     View::composer('partials.nav', function ($view) {
         $categories = Category::lists('title', 'id');
         $view->with(compact('categories'));
     });
 }
开发者ID:yinilauriot,项目名称:StarWars,代码行数:7,代码来源:RegisterController.php

示例10: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     //        $tags = Tag::all();
     $tags = Tag::lists('name', 'id');
     $categories = Category::lists('title', 'id');
     return view('admin.create', compact('tags', 'categories'));
 }
开发者ID:bocanico,项目名称:ProjetStarWars,代码行数:12,代码来源:ProductController.php

示例11: edit

 public function edit($id)
 {
     $product = Product::find($id);
     $categories = Category::lists('title', 'id');
     $tags = Tag::lists('name', 'id');
     return view('admin.edit', compact('product', 'tags', 'categories'));
 }
开发者ID:ivanovamarieta,项目名称:ProjetStarWars,代码行数:7,代码来源:ProductController.php

示例12: create

 /**
  * Montre la vue pour créer un article
  *
  * @return Response
  */
 public function create(Request $request)
 {
     $auth_id = Auth::user()->id;
     $categories = Category::lists('name', 'id');
     $jobs = Job::lists('name', 'id');
     return view('admin.posts.create', compact('auth_id', 'categories', 'jobs'));
 }
开发者ID:e-noumene,项目名称:Back,代码行数:12,代码来源:PostsController.php

示例13: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param Quote $quote
  *
  * @return Response
  * @internal param int $id
  */
 public function edit(Quote $quote)
 {
     $authors = Author::lists('name', 'id')->all();
     $categories = Category::lists('name', 'id')->all();
     $categoriesOfImages = ImageCategory::lists('name', 'id')->all();
     return view('admin.quote.edit', compact('quote'))->withTitle('Edit: ' . $quote->title)->withAuthors($authors)->withCategories($categories)->with('categoriesOfImages', $categoriesOfImages);
 }
开发者ID:vazmer,项目名称:mudrosti-laravel,代码行数:15,代码来源:QuoteController.php

示例14: profile

 public function profile($id)
 {
     $images = Auth::User()->uploaded_pictures;
     $categories = Category::lists('category_name', 'category_id');
     $user = User::findOrFail($id);
     return view('templates/singleProfile')->with(compact('user', 'images', 'categories'));
 }
开发者ID:Omniarate,项目名称:omniarate.dv,代码行数:7,代码来源:PagesController.php

示例15: edit

 public function edit($id, $extra = array())
 {
     $vara = \App\Product::find($id);
     $flokkar = array_merge([0 => ' - Veldu flokk - '] + \App\Category::lists('title', 'id')->toArray());
     $extra['flokkar'] = $flokkar;
     $extra['selectedFlokkurId'] = $vara->{$vara->parent_key} ?: 0;
     return parent::edit($id, $extra);
 }
开发者ID:snudur,项目名称:nvcms,代码行数:8,代码来源:ProductController.php


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