diff --git a/models/ParameterSearch.php b/models/ParameterSearch.php
index 788bb56..901da23 100644
--- a/models/ParameterSearch.php
+++ b/models/ParameterSearch.php
@@ -24,7 +24,7 @@ class ParameterSearch extends Parameter
public function search($params): ActiveDataProvider
{
- $query = Parameter::find();
+ $query = Parameter::find()->with(['icon', 'iconGray']);
$dataProvider = new ActiveDataProvider([
'query' => $query,
diff --git a/views/list/index.php b/views/list/index.php
index cd034dd..bd246e1 100644
--- a/views/list/index.php
+++ b/views/list/index.php
@@ -1,4 +1,5 @@
title = 'params list';
+
?>
Parameters
@@ -23,4 +25,34 @@ $this->title = 'params list';
= GridView::widget([
'dataProvider' => $provider,
'filterModel' => $searchModel,
+ 'columns' => [
+ 'id', 'title', 'type',
+ [
+ 'label' => 'Icon',
+ 'value' => function (Parameter $model) {
+ if ($model->icon) {
+ $url = '/api/image?sha256=' . $model->getRelatedRecords()['icon']->sha256;
+ return Html::a(Html::img($url, [ 'width' => 150, 'height' => 150 ]), $url, [ 'alt' => 'icon', 'target' => '_blank' ]);
+ }
+ },
+ 'format' => 'raw',
+ ],
+ [
+ 'label' => 'Gray Icon',
+ 'value' => function (Parameter $model) {
+ if ($model->iconGray) {
+ $url = '/api/image?sha256=' . $model->getRelatedRecords()['iconGray']->sha256;
+ return Html::a(Html::img($url, [ 'width' => 150, 'height' => 150 ]), $url, [ 'alt' => 'grayscale icon', 'target' => '_blank' ]);
+ }
+ },
+ 'format' => 'raw',
+ ],
+ [
+ 'label' => 'Edit',
+ 'value' => function (Parameter $model) {
+ return Html::a('Edit', '/list/edit?id=' . $model->id);
+ },
+ 'format' => 'raw',
+ ],
+ ]
]); ?>