?> <?php // echo $form->field($model, 'event')->textInput() ?> <?php echo $form->field($model, 'action_type')->dropDownList(MeritTemplate::getActionTypes()); ?> <?php echo $form->field($model, 'increment')->textInput(); ?> <?php echo $form->field($model, 'rule_key')->dropDownList(MeritTemplate::getRuleKeys()); ?> <?php echo $form->field($model, 'rule_value')->textInput(); ?> <?php echo $form->field($model, 'status')->dropDownList(MeritTemplate::getStatuses()); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div>
use yii\helpers\Html; use yii\widgets\DetailView; use yiier\merit\models\MeritTemplate; /* @var $this yii\web\View */ /* @var $model yiier\merit\models\MeritTemplate */ $this->title = $model->title; $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Merit Templates'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="merit-template-view"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), 'method' => 'post']]); ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'title', ['attribute' => 'type', 'value' => MeritTemplate::getTypes()[$model->type]], 'unique_id', ['attribute' => 'method', 'value' => MeritTemplate::getMethods()[$model->method]], ['attribute' => 'action_type', 'value' => MeritTemplate::getActionTypes()[$model->action_type]], 'increment', ['attribute' => 'rule_key', 'value' => MeritTemplate::getRuleKeys()[$model->rule_key]], 'rule_value', ['attribute' => 'status', 'value' => MeritTemplate::getStatuses()[$model->status]], 'created_at:datetime', 'updated_at:datetime']]); ?> </div>
<h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a(Yii::t('app', 'Create Merit Template'), ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['title', ['attribute' => 'type', 'value' => function ($data) { return MeritTemplate::getTypes()[$data->type]; }], 'unique_id', ['attribute' => 'method', 'value' => function ($data) { return MeritTemplate::getMethods()[$data->method]; }], ['attribute' => 'action_type', 'value' => function ($data) { return MeritTemplate::getActionTypes()[$data->action_type]; }], 'increment', ['attribute' => 'rule_key', 'value' => function ($data) { return MeritTemplate::getRuleKeys()[$data->rule_key]; }], 'rule_value', ['attribute' => 'status', 'value' => function ($data) { return MeritTemplate::getStatuses()[$data->status]; }], 'created_at:datetime', 'updated_at:datetime', ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>