title = Yii::t('catalog', 'Products'); $this->params[ 'breadcrumbs' ][] = $this->title; $category = Category::find() ->filterWhere( [ 'id' => $searchModel->category_title, ] ) ->with('lang') ->one(); $category_title = $category ? $category->lang->title : ''; ?>
Html::encode($this->title), ] ); ?> render('_search', ['model' => $searchModel]); ?>

'btn btn-success' ]) ?> 'pull-right btn btn-danger artbox-selection-delete', 'data-message' => \Yii::t('catalog', 'Delete selected rows?'), 'data-url' => Url::to([ 'delete-multiple' ]), ] ) ?>

$dataProvider, 'filterModel' => $searchModel, 'columns' => [ [ 'class' => 'yii\grid\CheckboxColumn', 'name' => 'artbox-selection', 'cssClass' => 'artbox-selection', ], 'id', [ 'attribute' => 'title', 'value' => 'lang.title', ], [ 'attribute' => 'category_title', 'value' => 'category.lang.title', 'filter' => Select2::widget( [ 'name' => 'ProductSearch[category_title]', 'value' => $searchModel->category_title, 'initValueText' => $category_title, 'options' => [ 'placeholder' => \Yii::t('catalog', 'Search for a category ...') ], 'pluginOptions' => [ 'allowClear' => true, 'minimumInputLength' => 3, 'language' => [ 'errorLoading' => new JsExpression( "function () { return 'Waiting for results...'; }" ), ], 'ajax' => [ 'url' => Url::to([ 'category/list' ]), 'dataType' => 'json', 'data' => new JsExpression( 'function(params) { return { q:params.term }; }' ), ], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression( 'function (category) { return category.text; }' ), 'templateSelection' => new JsExpression( 'function (category) { return category.text; }' ), ], ] ), ], [ 'attribute' => 'brand_title', 'value' => 'brand.lang.title', ], 'created_at:datetime', [ 'attribute' => 'status', 'format' => 'boolean', 'filter' => [ 0 => \Yii::$app->formatter->asBoolean(0), 1 => \Yii::$app->formatter->asBoolean(1), ], ], [ 'class' => 'yii\grid\ActionColumn', 'buttons' => [ 'variants' => function ($url, $model) { /** * @var Product $model */ return Html::a( Html::icon('align-justify'), [ '/variant/index', 'product_id' => $model->id, ] ); }, ], 'template' => '{variants} {view} {update} {delete}', ], ], ] ); ?>