コード例 #1
0
ファイル: index.php プロジェクト: sergey-exu/kio
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use backend\modules\feedback\models\Feedback;
$this->title = 'Обратная связь';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box box-primary">
    <div class="box-body">

        <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'created_at:date', 'email:email', 'message:ntext', ['attribute' => 'status', 'filter' => Feedback::getStatusArray(), 'value' => 'StatusName'], 'user_id', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}', 'contentOptions' => ['class' => 'actionColumn'], 'buttonOptions' => ['class' => 'btn btn-sm btn-default', 'style' => 'padding:1px 10px;']]]]);
?>
    </div>
</div>
コード例 #2
0
ファイル: _form.php プロジェクト: sergey-exu/kio
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
    
        <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => true]);
?>
    
        <?php 
echo $form->field($model, 'message')->textarea(['rows' => 6]);
?>
    
        <?php 
echo $form->field($model, 'answer')->textarea(['rows' => 6]);
?>
        
        <?php 
echo $form->field($model, 'status')->dropDownlist(Feedback::getStatusArray());
?>
    
        <div class="form-group">
            <?php 
echo Html::submitButton($model->isNewRecord ? 'Создать' : 'Обновить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        </div>
    
        <?php 
ActiveForm::end();
?>

    </div>
</div>