Example #1
0
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\LeaveMessage */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Leave Messages', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="leave-message-view">

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

    <p>
        <?php 
echo Html::a('Пометить как помечанный', ['mark', 'id' => $model->id, 'status' => \common\models\LeaveMessage::STATUS_MARKED], ['class' => 'btn btn-warning']);
?>
        <?php 
echo Html::a('Пометить как закрытый', ['mark', 'id' => $model->id, 'status' => \common\models\LeaveMessage::STATUS_CLOSED], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'name', 'email:email', 'message:ntext', ['attribute' => 'status', 'value' => \common\models\LeaveMessage::statusNames()[$model->status]], 'user_ip', 'created_at', 'updated_at']]);
?>

</div>
Example #2
0
use common\models\LeaveMessage;
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\guest\models\LeaveMessageSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Leave Messages';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="leave-message-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Create Leave Message', ['create'], ['class' => 'btn btn-success']);
?>
    </p>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'name', 'email:email', 'message:ntext', ['format' => 'html', 'attribute' => 'status', 'value' => function ($model) {
    return Html::tag('span', LeaveMessage::statusNames()[$model->status], ['class' => 'label label-' . LeaveMessage::statusClasses()[$model->status]]);
}, 'filter' => LeaveMessage::statusNames()], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view}']]]);
?>
</div>