$val){ $extParam .= $key . ":" . $val . ','; } } $token = csrf_token(); $html = <<
上传文件
EOF; return $html; } public function single2($folder, $id, $name="data", $file="", $option=[]){ $folder = urlencode($folder); $imgHtml = ""; $option['callback'] = isset($option['callback']) ? $option['callback'] : ""; if(!$option['callback'] && !empty($file)) { // $imgHtml .= "
  • × // \"{$file}\" //

    //

    //

    // //
  • "; $iconImage = in_array(fileExt($img['url']), ['jpg', 'png' , 'gif' , 'jpeg' , 'bmp']) ? "
    /
    " : "
    "; $imgHtml .="
  • {$iconImage}

    {$img['alt']}

    ×
  • "; } $html = <<
      $imgHtml
    •  
    EOF; return $html; } public function multi2($folder, $id, $name="data[image]", $files=[], $option=[]){ $folder = urlencode($folder); $imgHtml = ""; $option['callback'] = isset($option['callback']) ? $option['callback'] : ""; $option['max'] = isset($option['max']) ? $option['max'] : 200; $option['max'] = $option['max']-count($files); if(!$option['callback'] && !empty($files)) { foreach($files as $key=>$val) { if(is_string($val)) { $file['url'] = $val; $file['alt'] = ''; }else{ $file = $val; } /*$imgHtml .= "
  • × \"{$file['alt']}\"

  • ";*/ $iconImage = in_array(fileExt($file['url']), ['jpg', 'png' , 'gif' , 'jpeg' , 'bmp']) ? "
    /
    " : "
    "; $imgHtml .="
  • {$iconImage}

    {$file['alt']}

    ×
  • "; } } $html = <<
      $imgHtml
    •  
    EOF; return $html; } }