在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:lygfanye/yii2-image-upload开源软件地址:https://github.com/lygfanye/yii2-image-upload开源编程语言:JavaScript 65.4%开源软件介绍:ajaxImageUploadupload image via ajax InstallationThe preferred way to install this extension is through composer. Either run
or add
to the require section of your UsageOnce the extension is installed, simply use it in your code by : <a id="imageUpload" href="javascript:;">上传图片</a> <?= \troy\ImageUpload\ImageUpload::widget(
[
'targetId' => 'imageUpload',//html dom id
'config' =>[
'action' =>Yii::$app->getUrlManager()->createUrl(['site/index'])
]
]
); ?> You also can add some events for it such as onComplete function <?=
.....
use yii\web\JsExpression;
.....
\troy\ImageUpload\ImageUpload::widget(
[
'targetId' => 'imageUpload',//html dom id
'config' =>[
'action' =>Yii::$app->getUrlManager()->createUrl(['site/index']),
'onComplete' => new JsExpression("function(fileName, responseJSON){ something todo...... }")
]
]
);
?> if you want to the the UploadAction in this ext you can use :
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论