當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。