ajax-edit.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. use yii\widgets\ActiveForm;
  3. use common\helpers\Url;
  4. use common\enums\StatusEnum;
  5. use common\widgets\linkage\Linkage;
  6. $form = ActiveForm::begin([
  7. 'id' => $model->formName(),
  8. 'enableAjaxValidation' => true,
  9. 'validationUrl' => Url::to(['ajax-edit', 'id' => $model['id'], 'member_id' => $model['member_id']]),
  10. ]);
  11. ?>
  12. <div class="modal-header">
  13. <h4 class="modal-title">基本信息</h4>
  14. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  15. </div>
  16. <div class="modal-body">
  17. <?= $form->field($model, 'realname')->textInput() ?>
  18. <?= $form->field($model, 'mobile')->textInput() ?>
  19. <?= $form->field($model, 'zip_code')->textInput() ?>
  20. <?= Linkage::widget([
  21. 'form' => $form,
  22. 'model' => $model,
  23. 'template' => 'short',
  24. ]); ?>
  25. <?= $form->field($model, 'details')->textarea() ?>
  26. <?= $form->field($model, 'street_number')->textInput() ?>
  27. <?= $form->field($model, 'is_default')->checkbox() ?>
  28. <?= $form->field($model, 'status')->radioList(StatusEnum::getMap()) ?>
  29. </div>
  30. <div class="modal-footer">
  31. <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
  32. <button class="btn btn-primary" type="submit">保存</button>
  33. </div>
  34. <?php ActiveForm::end(); ?>
粤ICP备19079148号