edit.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. use yii\widgets\ActiveForm;
  3. use common\helpers\Url;
  4. use common\enums\StatusEnum;
  5. use common\enums\WhetherEnum;
  6. use common\enums\DevPatternEnum;
  7. use unclead\multipleinput\MultipleInput;
  8. $this->title = '编辑';
  9. $form = ActiveForm::begin([
  10. 'enableAjaxValidation' => false,
  11. 'validationUrl' => Url::to(['edit', 'id' => $model['id']]),
  12. 'fieldConfig' => [
  13. 'template' => "<div class='row'><div class='col-sm-2 text-right'>{label}</div><div class='col-sm-10'>{input}\n{hint}\n{error}</div></div>",
  14. ],
  15. ]);
  16. ?>
  17. <div class="col-12 pt-3">
  18. <div class="box">
  19. <div class="box-body">
  20. <?= $form->field($model, 'pid')->dropDownList($menuDropDownList) ?>
  21. <?= $form->field($model, 'title')->textInput() ?>
  22. <?= $form->field($model, 'name')->textInput() ?>
  23. <?= $form->field($model, 'url')->textInput()->hint("例如:/index/index,要绝对路由哦") ?>
  24. <?= $form->field($model, 'params')->widget(MultipleInput::class, [
  25. 'iconSource' => 'fa',
  26. 'max' => 10,
  27. 'columns' => [
  28. [
  29. 'name' => 'key',
  30. 'title' => '参数名',
  31. 'enableError' => false,
  32. 'options' => [
  33. 'class' => 'input-priority',
  34. ],
  35. ],
  36. [
  37. 'name' => 'value',
  38. 'title' => '参数值',
  39. 'enableError' => false,
  40. 'options' => [
  41. 'class' => 'input-priority',
  42. ],
  43. ],
  44. ],
  45. ])->label(false);
  46. ?>
  47. <?= $form->field($model, 'icon')->textInput()->hint('详情请参考:<a href="https://fontawesome.com" target="_blank">http://fontawesome.dashgame.com</a>') ?>
  48. <?= $form->field($model, 'sort')->textInput() ?>
  49. <?= $form->field($model, 'pattern')->checkboxList(DevPatternEnum::getMap())->hint('不选则全部可见') ?>
  50. <?= $form->field($model, 'dev')->radioList(WhetherEnum::getMap())->hint('去 网站设置->系统设置 里面开启或关闭开发模式,开启后才可显示该菜单') ?>
  51. <?= $form->field($model, 'status')->radioList(StatusEnum::getMap()) ?>
  52. </div>
  53. </div>
  54. </div>
  55. <?php ActiveForm::end(); ?>
粤ICP备19079148号