Переделал виджет, более читаем

This commit is contained in:
maxim
2021-09-13 16:40:37 +03:00
parent 4b08696ed2
commit 358ffbf794
12 changed files with 255 additions and 249 deletions

View File

@ -0,0 +1,34 @@
<?php
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
echo GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute' => 'today',
'format' => 'raw',
'value' => function ($model) {
$text = '';
if ($model->task) {
$i = 1;
foreach ($model->task as $task) {
$text .= "<p>$i. ($task->hours_spent ч.) $task->task</p>";
$i++;
}
}
return $text;
}
],
'difficulties',
'tomorrow',
['class' => 'yii\grid\ActionColumn'],
],
]);
die();