<?php use yii\helpers\Html; use yii\grid\GridView; use app\models\MWxAction; /* @var $this yii\web\View */ /* @var $searchModel common\models\search\MWxActionSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('backend', 'Wechat Actions'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="mwx-action-index"> <p> <?php echo Html::a(Yii::t('backend', 'Create Wechat Action'), ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['wx_action_id', ['attribute' => 'keyword', 'value' => function ($model, $key, $index, $column) { return $model->getKeywordAlias(); }], ['attribute' => 'type', 'value' => function ($model, $key, $index, $column) { return MWxAction::getActionTypeOptionName($model->type); }, 'filter' => MWxAction::getActionTypeOptionName()], 'action:ntext', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]); ?> </div>
$form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'inputEventType')->dropDownList(MWxAction::getInputEventTypeOptionName()); ?> <div class="keyword"> <?php echo $form->field($model, 'keyword')->textInput(['maxlength' => 128]); ?> </div> <?php echo $form->field($model, 'type')->dropDownList(MWxAction::getActionTypeOptionName()); ?> <div class="text"> <?php echo $form->field($model, 'content')->textarea(['rows' => 3])->label('内容'); ?> </div> <div class="news"> <?php echo $form->field($model, 'title')->textInput(['maxlength' => 256])->label('标题'); ?> <?php