Skip to content

Commit

Permalink
Update FormHelper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
funadmin authored Apr 14, 2022
1 parent 8187c48 commit fbb24f1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ public static function icon($name = '', $options = [], $value = '')
{
$name = $name ? $name : 'icon';
$value = $value ? $value : 'layui-icon-rate';
$id = $options['id'] ?? 'iconPicker';
$id = $options['id'] ?? $name;
$str = '<div class="layui-form-item">
<label class="layui-form-label ' . self::labelRequire($options) . '">' . lang('Icon') . '</label>
<div class="layui-input-block">
Expand Down Expand Up @@ -591,15 +591,15 @@ public static function date($name='', $options=[], $value='')
*/
public static function city($name = 'cityPicker', $options = [])
{
$id = $options['id'] ?? 'iconPicker';
$id = $options['id'] ?? $name;
$options['provinceId'] = $options['provinceId'] ?? 'province_id';
$options['cityId'] = $options['cityId'] ?? 'city_id';
$options['districtId'] = $options['districtId'] ?? 'area_id';
$attr = 'data-districtid="' . $options['districtId'] . '" data-cityid="' . $options['cityId'] . '" data-provinceid="' . $options['provinceId'] . '"';
$str = ' <div class="layui-form-item">
<label class="layui-form-label width_auto text-r" style="margin-top:2px">省市县:</label>
<div class="layui-input-block">
<input ' . self::addextend($options) . ' type="hidden" autocomplete="on" cclass="layui-input ' . self::addClass($options) . '" ' . $attr . ' lay-filter="cityPicker" id="' . $id . '" name="' . $name . '" readonly="readonly" data-toggle="city-picker" placeholder="请选择"/>
<input ' . self::addextend($options) . ' type="hidden" autocomplete="on" class="layui-input ' . self::addClass($options) . '" ' . $attr . ' lay-filter="cityPicker" id="' . $id . '" name="' . $name . '" readonly="readonly" data-toggle="city-picker" placeholder="请选择"/>
</div>
</div>';
return $str;
Expand All @@ -613,7 +613,7 @@ public static function city($name = 'cityPicker', $options = [])
*/
public static function region($name = 'regionCheck', $options = [])
{
$id = $options['id'] ?? 'iconPicker';
$id = $options['id'] ?? $name;
$str = ' <div class="layui-form-item">
<label class="layui-form-label ">区域</label>
<div class="layui-input-block">
Expand Down Expand Up @@ -668,13 +668,12 @@ public static function editor($name = 'container', $type = 1, $options = [], $va
*/
public static function upload($name = 'avatar', $formData = '', $options = [], $value = '')
{
$id = $name;
if (!isset($options['type'])) $options['type'] = 'radio';
if (!isset($options['mime'])) $options['mime'] = 'image';
if (!isset($options['num'])) $options['num'] = 1;
if (isset($options['num']) && $options['num'] == '*') $options['num'] = 100;
if (!isset($options['path'])) $options['path'] = 'upload'; //上传路劲
if (isset($options['id'])) $id = $options['id']; //ID
$id = $options['id']??$name;
$css = isset($options['css']) ? $options['css'] : 'display:inline-block;';
$label = $options['label'] ?? $name;
$li = '';
Expand Down

0 comments on commit fbb24f1

Please sign in to comment.