本文整理汇总了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);
}
示例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/');
}
示例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