_item.php 998 Bytes
Newer Older
Mark committed
1
<?php
2 3 4
/**
 * @var array $model
 */
Mark committed
5 6 7 8 9 10 11

use yii\helpers\Html;
use yii\widgets\DetailView;

$timeFormatter = extension_loaded('intl') ? Yii::createObject(['class' => 'yii\i18n\Formatter']) : Yii::$app->formatter;

echo DetailView::widget([
12 13 14 15 16 17 18 19 20
    'model' => $model,
    'attributes' => [
        'headers',
        'from',
        'to',
        'charset',
        [
            'attribute' => 'time',
            'value' => $timeFormatter->asDateTime($model['time'], 'short'),
21
        ],
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
        'subject',
        [
            'attribute' => 'body',
            'label' => 'Text body',
        ],
        [
            'attribute' => 'isSuccessful',
            'label' => 'Successfully sent',
            'value' => $model['isSuccessful'] ? 'Yes' : 'No'
        ],
        'reply',
        'bcc',
        'cc',
        [
            'attribute' => 'file',
            'format' => 'html',
            'value' => Html::a('Download eml', ['download-mail', 'file' => $model['file']]),
        ],
    ],
Mark committed
41
]);