yii2-widget-fileinput
Posted 派森工作室 联系方式 13957995397
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了yii2-widget-fileinput相关的知识,希望对你有一定的参考价值。
<?php echo ‘<label class="control-label">任务图片</label>‘; echo FileInput::widget([ ‘name‘ => ‘task_image_property[]‘, ‘options‘ => [ ‘accept‘ => ‘image/*‘, ‘multiple‘ => true ], ‘pluginOptions‘ => [ ‘showUpload‘ => false,‘initialPreview‘ => ‘‘, ‘initialPreviewAsData‘ => true, ‘initialPreviewShowDelete‘ => true, ‘fileActionSettings‘ => [ ‘showRemove‘ => false, ], ‘overwriteInitial‘ => true, ‘previewFileType‘ => ‘any‘, ‘uploadAsync‘=> true, ‘uploadUrl‘ => Url::to([‘image/img-upload‘]) ], ‘pluginEvents‘ => [ ‘filebatchselected‘ => "function (event, files){ $(this).fileinput(‘upload‘);//选择文件后自动上传 }", ] ]); ?>
以上是关于yii2-widget-fileinput的主要内容,如果未能解决你的问题,请参考以下文章