_profile.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use common\enums\GenderEnum;
  3. use common\modules\attachment\widgets\SingleWidget;
  4. use common\modules\city\widgets\CityWidget;
  5. use yii\bootstrap\ActiveForm;
  6. use yii\helpers\Html;
  7. /**
  8. * @var yii\web\View $this
  9. * @var common\modules\user\models\User $user
  10. * @var common\modules\user\models\Profile $profile
  11. */
  12. ?>
  13. <?php $this->beginContent(__DIR__ . '/update.php', ['user' => $user]) ?>
  14. <?php $form = ActiveForm::begin(); ?>
  15. <?= $form->field($profile, 'avatar')->widget(SingleWidget::className(), ['onlyUrl' => true]) ?>
  16. <div class="form-group form-inline">
  17. <?= $form->field($profile, 'province')->textInput() ?>
  18. <?= $form->field($profile, 'city')->textInput() ?>
  19. </div>
  20. <?//= $form->field($profile, 'area')->label('所在地')->widget(CityWidget::className(), [
  21. // 'provinceAttribute' => 'province',
  22. // 'cityAttribute' => 'city',
  23. // 'areaAttribute' => 'area'
  24. //]) ?>
  25. <?= $form->field($profile, 'gender')->dropDownList(GenderEnum::$list) ?>
  26. <?= $form->field($profile, 'signature')->textarea() ?>
  27. <?//= $form->field($profile, 'voice_id')->textInput() ?>
  28. <div class="form-group">
  29. <?= Html::submitButton(Yii::t('app', 'Update'), ['class' => 'btn bg-maroon btn-flat btn-block']) ?>
  30. </div>
  31. <?php ActiveForm::end(); ?>
  32. <?php $this->endContent() ?>