<?php
    /**
     * @var $productProvider \yii\data\ActiveDataProvider
     * @var View $this
     * @var ArrayDataProvider $productProvider
     */
    use frontend\widgets\FilterWidget;
    use frontend\widgets\Seo;
    use yii\data\ArrayDataProvider;
    use yii\helpers\Url;
    use yii\web\View;
    use yii\widgets\ListView;
    use yii\widgets\Pjax;
    $this->registerCssFile (Yii::getAlias('@web/css/ion.rangeSlider.css'));
    $this->registerCssFile (Yii::getAlias('@web/css/ion.rangeSlider.skinHTML5.css'));
    $this->registerJsFile(Yii::getAlias('@web/js/ion.rangeSlider.js'),[
        'position' => View::POS_END,
        'depends' => ['yii\web\JqueryAsset']
    ]);




    $this->params['seo']['title'] = !empty($category->meta_title) ? $category->meta_title : $category->name;

    $this->params['seo']['fields']['meta-title'] = $category->meta_title;
    $this->params['seo']['h1'] = !empty($category->h1) ? $category->h1 : $category->name;
    $this->params['seo']['seo_text'] = $category->seo_text;



    $this->params['seo']['description'] = $category->meta_desc;
    if(empty($productProvider->allModels)){
        $this->params['seo']['meta'] = 'noindex,nofollow';
    }else{
        $this->params['seo']['meta'] = $category->meta_robots;
    }

    $this->params['seo']['category_name'] = $category->name;

    $this->params['breadcrumbs'][] = $category->name;
    $this->registerCssFile (Yii::getAlias('@web/css/ion.rangeSlider.css'));
    $this->registerCssFile (Yii::getAlias('@web/css/ion.rangeSlider.skinHTML5.css'));
    $this->registerJsFile(Yii::getAlias('@web/js/ion.rangeSlider.js'),[
        'position' => View::POS_END,
        'depends' => ['yii\web\JqueryAsset']
    ]);
    $this->registerJsFile(Yii::getAlias('@web/js/filter.js'),[
        'position' => View::POS_END,
        'depends' => ['yii\web\JqueryAsset']
    ]);
?>
<?php Pjax::begin(['timeout' => 5000,'id'=> 'list-container'])?>
            <div class="container">
                <div class="block-25" style="position: relative;">
                    <?= FilterWidget::widget([
                        'category'=>$category,
                        'groups'=>  $groups,
                        'filter'=>  $filter,
                        'priceLimits' => $priceLimits,
                        //'filterBrands' => $filterBrands
                    ])?>

                    <div class="clearfix"></div>




                    <div class="columnLeftInfo">
                        <!-- del_columnLeftInfo -->






                        <!-- del_columnLeftInfo_end -->
                    </div>




                </div>
                <div class="block-75">

                    <h1 class="title"><?= Seo::widget([ 'row'=>'h1'])?></h1>

                    <div class="list_filters_links">

                        <div class="sort_block">

                            <span>Сортировка:</span>
                            <?= \yii\widgets\LinkSorter::widget([
                                'sort' => $productProvider->sort,
                                'attributes' => [
                                    'price',
                                ]
                            ]);
                            ?>
                        </div>
                        <div class="clearfix"></div>
                    </div>



                    <div class="clearfix"></div>








                    <div class="catalog_product_list view_table">


                        <?= ListView::widget([
                            'dataProvider' => $productProvider,
                            'itemView' => function ($model, $key, $index, $widget) use($category) {
                                return $this->render('_product_item',[
                                    'model' => $model,
                                    'category' => $category
                                ]);
                            },
                            'layout' => "{items}<div class=\"clearfix\"></div>{pager}",
                        ])

                        ?>




                        <div class="clearfix"></div>
                    </div>

                </div>
            </div>
<?php Pjax::end()?>


