Commit 2134617436b7aebfcef8ace19be54ff7b2ae30c0

Authored by Anastasia
1 parent 24f51378

roles and comments

Showing 1 changed file with 15 additions and 0 deletions   Show diff stats
views/manage/index.php
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
7 use yii\helpers\StringHelper; 7 use yii\helpers\StringHelper;
8 use yii\web\View; 8 use yii\web\View;
9 use yii\widgets\Pjax; 9 use yii\widgets\Pjax;
  10 + use yii\helpers\Url;
  11 + use yii\helpers\Json;
10 12
11 /** 13 /**
12 * @var ActiveDataProvider $dataProvider 14 * @var ActiveDataProvider $dataProvider
@@ -48,6 +50,19 @@ @@ -48,6 +50,19 @@
48 }, 50 },
49 ], 51 ],
50 [ 52 [
  53 + 'label' => \Yii::t('artbox-comment', 'Сущность '),
  54 + 'content' => function (CommentModel $model) {
  55 + $entity = call_user_func($model->entity.'::find');
  56 + $item = $entity->where(['id' => $model->entity_id])->with(['lang' , 'lang.alias'])->one();
  57 + if ($urlManagerFrontend = \Yii::$app->get('urlManagerFrontend', false)) {
  58 +
  59 + return "<a href='".$urlManagerFrontend->createUrl(Json::decode($item->lang->alias->route))."'>".$item->lang->title."</a>";
  60 + }
  61 +
  62 + return $item->lang->title;
  63 + },
  64 + ],
  65 + [
51 'attribute' => 'customer_id', 66 'attribute' => 'customer_id',
52 'value' => function ($model) { 67 'value' => function ($model) {
53 /** 68 /**