_form.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use common\modules\attachment\widgets\SingleWidget;
  3. use common\modules\city\widgets\CityWidget;
  4. use yii\helpers\Html;
  5. use yii\widgets\ActiveForm;
  6. /* @var $this yii\web\View */
  7. /* @var $model common\models\Warehouse */
  8. /* @var $form yii\widgets\ActiveForm */
  9. ?>
  10. <div class="box box-success">
  11. <div class="box-body">
  12. <?php $form = ActiveForm::begin(); ?>
  13. <?= $form->field($model, 'area')->label('区域')->widget(CityWidget::className(), [
  14. 'provinceAttribute' => 'province',
  15. 'cityAttribute' => 'city',
  16. 'areaAttribute' => 'area'
  17. ]) ?>
  18. <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
  19. <?= $form->field($model, 'icon')->hint('规格:80px * 80px,<a target="blank" href="https://www.iconfont.cn/">下载图标库</a>')->widget(SingleWidget::className()) ?>
  20. <div class="form-group">
  21. <?= Html::submitButton($model->isNewRecord ? Yii::t('common', 'Create') : Yii::t('common', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success btn-flat' : 'btn btn-primary btn-flat']) ?>
  22. </div>
  23. <?php ActiveForm::end(); ?>
  24. </div>
  25. </div>