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


PHP Product::collections方法代码示例

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


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

示例1: makeProduct

 function makeProduct($page = [])
 {
     $collections = (array) \App\Product::collections();
     $num = mt_rand(0, count($collections) - 1);
     $i = 0;
     $collection = '';
     foreach ($collections as $k => $v) {
         if ($i == $num) {
             $collection = $k;
         }
         $i++;
     }
     $page['slug'] = isset($page['slug']) ? $page['slug'] : str_slug($page['title']);
     $page['images'] = isset($page['images']) ? $page['images'] : imgs();
     $page['tech'] = isset($page['tech']) ? $page['tech'] : '';
     $page['collection'] = $collection;
     $page['karlar'] = mt_rand(0, 1);
     $page['konur'] = mt_rand(0, 1);
     $array = \App\Product::product_types();
     $key = array_rand($array);
     $value = $array[$key];
     //print_r($bla[(mt_rand(0, count(\App\Product::product_types()) - 1))]);
     //$page['product_type'] = key(\App\Product::product_types()[(mt_rand(0, count(\App\Product::product_types()) - 1))]);
     //echo $key;
     $page['product_type'] = $key;
     return factory(\App\Product::class)->create($page);
 }
开发者ID:stjanilofts,项目名称:sign,代码行数:27,代码来源:DatabaseSeeder.php

示例2: vorulina

 public function vorulina($vorulina)
 {
     $collections = \App\Product::collections();
     if (array_key_exists($vorulina, $collections)) {
         $data['items'] = \App\Product::where('collection', $vorulina)->orderBy('category_id')->orderBy('order')->get();
         $data['pagetitle'] = $collections[$vorulina]['title'];
         return view('frontend.products')->with($data);
     }
     return redirect()->to('/vefverslun/');
 }
开发者ID:stjanilofts,项目名称:sign,代码行数:10,代码来源:VorukerfiController.php

示例3: url

                </nav>
            </div>

            @if(frontpage())
                <div class="Front">
                    <ul class="uk-slideshow" data-uk-slideshow="{autoplay:true}">
                        <li style="background-image: url('/img/big.jpg');" width="" height="" alt=""></li>
                    </ul>
                </div>

                <div class="Lengja">
                    <h3 data-uk-scrollspy="{cls:'uk-animation-fade', delay:900}">Hjá SIGN eru hannaðir og smíðaðir fallegir skartgripir sem gjarnan endurspegla það fallega og dulræna sem býr í íslenskri náttúru.</h3>
                </div>

                <?php 
$collections = \App\Product::collections();
?>
                <div class="Boxes">
                    <div class="uk-grid uk-grid-collapse uk-grid-match" data-uk-grid-match="{target:'.Box'}">
                        @foreach($collections as $key => $collection)
                            <div class="uk-width-large-1-3 uk-width-small-1-2">
                                <div class="Box Box--shaded" style="background-image: url('/imagecache/large/{{ $collection['image'] }}')">
                                    <div class="Box--content">
                                        <div class="uk-flex uk-flex-center uk-flex-middle uk-height-1-1 uk-flex-column">
                                            <h2>{{ $collection['title'] }}</h2>
                                            <a href="/vefverslun/vorulina/{{ $key }}" class="fancy-takki takki--contrast">Skoða</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        @endforeach
开发者ID:stjanilofts,项目名称:sign,代码行数:31,代码来源:layout.blade.php


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