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 13, 2022
1 parent 10d8e65 commit 8187c48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -668,11 +668,13 @@ 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
$css = isset($options['css']) ? $options['css'] : 'display:inline-block;';
$label = $options['label'] ?? $name;
$li = '';
Expand All @@ -686,7 +688,7 @@ public static function upload($name = 'avatar', $formData = '', $options = [], $
$crpperops = 'data-value="' . json_encode($cops, true) . '"';
$croper_container = '<button type="button"
' . $crpperops . '
class="layui-btn layui-btn-warm" lay-filter="cropper" id="cropper">'
class="layui-btn layui-btn-warm" lay-filter="cropper" id="' .$id .'">'
. lang('Cropper') .
'</button>';
$options['num'] = 1;
Expand Down

0 comments on commit 8187c48

Please sign in to comment.