<option value="user_level">级别</option> <option value="all_user">全体用户</option> </select> <div class="help-block"></div> </div> 用户名例如:张教练,级别例如:C级,全体用户不用填写 <?php echo $form->field($model, 'users_id')->textInput(['style' => 'width:600px;']); ?> <input name="MessagesUsers[type]" value="<?php echo $type; ?> " type="hidden"> <?php echo $form->field($model, 'messages_id')->dropDownList(array_merge(array('' => '请选择模板'), ArrayHelper::map(\app\models\Messages::getAll(), 'id', 'title')), ['style' => 'width:500px;', 'onChange' => 'return showContent();', 'id' => 'messages_id']); ?> <?php echo $form->field($model, 'content')->textarea(['style' => 'width:500px;', 'id' => 'content']); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?>