index.php
2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/** @var $this \yii\web\View */
/** @var $productProvider \yii\data\ActiveDataProvider */
/** @var $brandProvider \yii\data\ActiveDataProvider */
use yii\helpers\Url;
use common\modules\product\helpers\ProductHelper;
$page_data = [
'keywords' => implode(' ', $keywords),
];
$this->params['breadcrumbs'][] = ['label' => 'Поиск', 'url' => ['catalog/category', 'word' => implode(' ', $keywords)]];
//$this->params['seo']['seo_text'] = 'TEST SEO TEXT';
//$this->params['seo']['h1'] = 'TEST H1';
//$this->params['seo']['description'] = 'TEST DESCRIPTION';
//$this->params['seo']['fields']['name'] = 'TEST NAME FROM FIELD';
$this->params['seo']['meta']= 'noindex,follow';
?>
<nav class="bread-crumbs">
<?= \yii\widgets\Breadcrumbs::widget ([
'links' => $this->params['breadcrumbs'],
])
?>
<div class="both"></div>
</nav>
<div class="loyout">
<?php if(!empty($categories)) :?>
<div class="leftbar">
<form action="#" name="filter_catalog_page_form" class="filter-catalog-form">
<div class="filters">
<div class="begin">Категории</div>
<ul>
<?php foreach ($categories as $_category) :
$checked = !empty($category) && $category->category_id == $_category->category_id;
$option_url = $checked ? Url::to(['catalog/category', 'word' => implode(' ', $keywords)]) : Url::to(['catalog/category', 'category' => $_category, 'word' => implode(' ', $keywords)]);
?>
<li>
<input type="checkbox" class="brands-option" <?= $checked ? ' checked' : ''?> onchange="document.location='<?= $option_url?>'" />
<a href="<?= $option_url?>"><?= $_category->name?><?php // @todo count?></a>
</li>
<?php endforeach?>
</ul>
</div>
</form>
</div>
<?php endif ?>
<div class="content">
<h1>Поиск</h1>
<div class="ten"></div>
<div class="products pn">
<ul>
<?php foreach($productProvider->models as $product) :?>
<?= $this->render('/catalog/product_item.php', ['product' => $product])?>
<?php endforeach?>
</ul>
<div class="both"></div>
</div>
</div>
</div>