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


PHP Category::lists方法代码示例

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


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

示例1: edit

 public function edit($id, Category $category)
 {
     $product = $this->productsmodel->find($id);
     $categories = $category->lists('name', 'id');
     $tags = $product->tag_list;
     return view('products.edit', compact('product', 'categories'), compact('tags'));
 }
开发者ID:mborgesmartins,项目名称:lcodecommerce,代码行数:7,代码来源:ProductsController.php

示例2: edit

 public function edit($id)
 {
     $list_options = ['Não', 'Sim'];
     $categories = Category::lists('name', 'id');
     $product = $this->productModel->find($id);
     return view('products.edit', compact('product', 'list_options', 'categories'));
 }
开发者ID:efraimsantana,项目名称:CodeCommerce,代码行数:7,代码来源:AdminProductsController.php

示例3: edit

 public function edit($id, Category $category)
 {
     $categories = $category->lists('name', 'id');
     $product = $this->products->find($id);
     $tags = $product->tags->lists('name')->toArray();
     $tags = implode(",", $tags);
     return view('admin.products.edit', compact('product', 'categories', 'tags'));
 }
开发者ID:houstonfernandes,项目名称:curso_laravel,代码行数:8,代码来源:AdminProductsController.php

示例4: edit

 public function edit($id, Category $category)
 {
     $categories = $category->lists('name', 'id');
     $product = $this->product->find($id);
     $tagsString = $this->product->transformaString($product->tags);
     return $this->factory->make('admin.products.edit', compact('product', 'categories', 'tagsString'));
     //return view('admin.products.edit', compact('product', 'categories', 'tagsString'));
 }
开发者ID:shuttzz,项目名称:laravel-commerce,代码行数:8,代码来源:AdminProductsController.php

示例5: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id, Category $category, Tag $tag, Color $color)
 {
     // envio as categorias para a view products.create
     $categories = $category->lists('name', 'id');
     $product = $this->model->find($id);
     $tags = $tag->lists('name');
     $colors = $color->lists('name');
     return view('products.edit', compact('product', 'categories', 'tags', 'colors'));
 }
开发者ID:NiltonMorais,项目名称:CodeCommerce,代码行数:15,代码来源:AdminProductsController.php

示例6: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Category $category, $id)
 {
     $product = $this->productModel->find($id);
     $categories = $category->lists('name', 'id');
     $tags = '';
     foreach ($product->tags as $tag) {
         $tags .= ' ' . $tag->name . ',';
     }
     return view('products.edit', compact('product', 'categories', 'tags'));
 }
开发者ID:alansslva,项目名称:codecommerce,代码行数:16,代码来源:AdminProductsController.php

示例7: edit

 public function edit($id, Category $category)
 {
     $categories = $category->lists('name', 'id');
     $product = $this->productModel->find($id);
     $tags = array();
     for ($i = 0; $i < count($product->tags); $i++) {
         array_push($tags, $product->tags[$i]->name);
     }
     $tags = implode(', ', $tags);
     return view('products.edit', compact('product', 'categories', 'tags'));
 }
开发者ID:arliton,项目名称:CodeCommerce,代码行数:11,代码来源:AdminProductsController.php

示例8: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id, Category $category)
 {
     $categories = $category->lists('name', 'id');
     $product = $this->productModel->find($id);
     $tags = $product->tags;
     $tags = $product->tags->lists('name');
     $tagFormatada = "";
     foreach ($tags as $t) {
         $tagFormatada .= trim($t) . ",";
     }
     $tagFormatada = trim($tagFormatada);
     return view('products.edit', compact('product', 'categories', 'tagFormatada'));
 }
开发者ID:mlslucio,项目名称:e-commerce-school-of-net,代码行数:19,代码来源:ProductsController.php

示例9: edit

 public function edit($id, Category $category)
 {
     $categories = $category->lists('name', 'id');
     $produtos = $this->produtoModel->find($id);
     return view('produtos.edit', compact('produtos', 'categories'));
 }
开发者ID:sandrosales,项目名称:laravel_commerce-Checkout03,代码行数:6,代码来源:ProdutosController.php

示例10: edit

 public function edit(Category $category, $id)
 {
     $categories = $category->lists('name', 'id');
     $product = $this->productModel->find($id);
     return view('products.edit', compact('product', 'categories'));
 }
开发者ID:eltonsantos,项目名称:codecommerce,代码行数:6,代码来源:ProductsController.php

示例11: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id, Category $category)
 {
     $product = $this->product->find($id);
     $categories = $category->lists("name", 'id');
     return view('admin.products.edit', compact('product', 'categories'));
 }
开发者ID:kzoty,项目名称:laravel_commerce,代码行数:12,代码来源:AdminProductsController.php

示例12: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @param Category $category
  * @return \Illuminate\Http\Response
  */
 public function edit($id, Category $category)
 {
     $product = $this->product->find($id);
     $categories = $category->lists('name', 'id');
     $categories->prepend('Select a category');
     return view('admin.products.form', compact('product', 'categories'));
 }
开发者ID:netoudi,项目名称:laravel,代码行数:14,代码来源:AdminProductsController.php

示例13: edit

 public function edit($id, Category $category)
 {
     $product = $this->productModel->find($id);
     $categories = ['' => 'Select'] + $category->lists('name', 'id')->all();
     return view('products.edit', compact('product', 'categories'));
 }
开发者ID:andrejose,项目名称:curso_laravel_commerce,代码行数:6,代码来源:ProductsController.php

示例14: edit

 public function edit($id, Category $category)
 {
     $product = $this->productModel->find($id);
     $categories = $category->lists('name', 'id');
     return view('products.edit', ['product' => $product, 'categories' => $categories]);
 }
开发者ID:jamesfsilva,项目名称:code-commerce,代码行数:6,代码来源:AdminProductsController.php

示例15: edit

 public function edit(\CodeCommerce\Product $product, Category $category)
 {
     $categories = $category->lists('name', 'id');
     return view('products.edit', compact('product', 'categories'));
 }
开发者ID:eduardolcouto,项目名称:laravel-commerce,代码行数:5,代码来源:AdminProductsController.php


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