コード例 #1
0
<?php

use yii\helpers\Html;
use infoweb\email\models\Email;
$this->title = Yii::t('app', 'View {modelClass}', ['modelClass' => Yii::t('infoweb/email', 'Email')]);
$this->params['breadcrumbs'][] = ['label' => Yii::t('infoweb/email', 'Emails') . ': ' . strtolower(Email::actionTypes()[Yii::$app->session->get('emails.actionType')]), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => "#{$model->id}", 'url' => ['update', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'View');
?>
<div class="email-update">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>
コード例 #2
0
}, 'filterType' => GridView::FILTER_DATE, 'filterWidgetOptions' => ['pluginOptions' => ['format' => 'dd-mm-yyyy', 'autoclose' => true, 'todayHighlight' => true]], 'width' => '220px', 'hAlign' => 'center'], ['class' => 'kartik\\grid\\ActionColumn', 'template' => $buttonsTemplate, 'buttons' => ['resend' => function ($url, $model) {
    if (Yii::$app->session->get('emails.actionType') != Email::ACTION_SENT) {
        return false;
    }
    $resent = $model->getHistory()->resent()->count();
    $resentLabel = '';
    if ($resent) {
        $resentLabel = "&nbsp;<span class=\"label label-danger\">{$resent}</span>";
    }
    return Html::a("<span class=\"glyphicon glyphicon-send\"></span>{$resentLabel}", Url::toRoute(['email/update', 'id' => $model->id]), ['title' => Yii::t('infoweb/email', 'Resend'), 'data-pjax' => '0', 'data-toggle' => 'tooltip', 'class' => 'resend-btn']);
}], 'updateOptions' => ['title' => Yii::t('app', 'View'), 'data-toggle' => 'tooltip'], 'deleteOptions' => ['title' => Yii::t('app', 'Delete'), 'data-toggle' => 'tooltip'], 'width' => '120px']];
?>
<div class="email-index">
    <?php 
// Title
$actionTypes = Email::actionTypes();
if (!Yii::$app->getModule('email')->enableSent) {
    unset($actionTypes[Email::ACTION_SENT]);
}
?>
    <h1>
        <?php 
echo Html::encode($this->title);
?>
        : <?php 
echo Html::radioButtonGroup('actionType', Yii::$app->session->get('emails.actionType'), $actionTypes);
?>

        <?php 
// Buttons
?>