PHP Classes

File: views/panel/dashboard.php

Recommend this page to a friend!
  Classes of Uldis Nelsons   D3 Notification   views/panel/dashboard.php   Download  
File: views/panel/dashboard.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: D3 Notification
Register handler for change events in model object
Author: By
Last change:
Date: 3 years ago
Size: 1,327 bytes
 

Contents

Class file image Download
<?php

use d3yii2\d3notification\dictionaries\D3nStatusDictionary;
use
d3yii2\d3notification\dictionaries\D3nTypeDictionary;
use
eaBlankonThema\widget\ThTableSimple2;

$statusList = D3nStatusDictionary::getList();
$typeList = D3nTypeDictionary::getList();
/** @var array $data */
echo ThTableSimple2::widget([
   
'tableOptions' => [
       
'class' => 'table table-striped table-success'
   
],
   
'title' => Yii::t('d3notification', 'Notifications'),
   
'columns' => [
        [
           
'header' => Yii::t('d3notification', 'Type'),
           
'value' => static function (array $row) use ($typeList) {
                return
$typeList[$row['type_id']] ?? $row['type_id'];
            },
        ],
        [
           
'header' => Yii::t('d3notification', 'Count'),
           
'attribute' => 'cnt',
        ],
        [
           
'header' => Yii::t('d3notification', 'Status'),
           
'value' => static function (array $row) use ($statusList) {
                return
$statusList[$row['status_id']] ?? $row['status_id'];
            },
        ],
        [
           
'header' => Yii::t('d3notification', 'From'),
           
'attribute' => 'minTime',
        ],
        [
           
'header' => Yii::t('d3notification', 'To'),
           
'attribute' => 'maxTime',
        ],
    ],
   
'data' => $data
]);