123456789101112131415 |
- function downfiles($field, $value, $fieldinfo) {
- extract($fieldinfo);
- $require = $min_length ? 'required required_upload' : '';
- $file_type = str_replace('|',',',$file_type);
- $max_size = intval($max_size);
- $fileSingleSizeLimit = isset($max_size)?$max_size*1024*1024:null;
- $string = '<div class="mb-3 row '.$require.'" data-name="'.$field.'">';
- $string .= '<label class="col-md-2 col-form-label">'.$fieldinfo['name'].'</label>';
- $string .= '<div class="col-md-10">';
- $string .= manks\FileInput::widget(['clientOptions' => ['pick' => ['multiple' => true],'buttonTxt'=>'选择文件','uploadType'=>2,'fileNumLimit'=>$max_num,'fileSingleSizeLimit'=>$fileSingleSizeLimit,'accept' => ['title' => 'Files','extensions' => $file_type,'mimeTypes' => '*']],'name'=>$fieldinfo['field'],'value'=>$value]);
- $string .= '</div>';
- $string .= $fieldinfo['tips']?'<div class="text-muted input-word-aux offset-l-2">提示:'.$fieldinfo['tips'].'</div>':'';
- $string .= '</div>';
- return $string;
- }
|