flsouto/htupload
Composer 安装命令:
composer require flsouto/htupload
包简介
Plugin widget for flsouto/htform which enables file uploads.
README 文档
README
Plugin for flsouto/htform which enables file uploads.
Usage
Creating and rendering:
<?php $up = new HtUpload("attachment",$savedir=__DIR__); $up->label($label="Choose a file"); // echo $up to output the widget
Processing the submit:
<?php $up = new HtUpload("attachment",__DIR__); $up->label(['text'=>'Choose a file','selected'=>'Attachment: %s']); $result = $up->process(); // $result->output contains filename
Add validations:
<?php $up = new HtUpload("attachment",__DIR__); $up->accept(['application/pdf','application/doc'],'Only pdf/doc is allowed!'); $result = $up->process(); // result->error contains error message
<?php $up = new HtUpload("attachment",__DIR__); $up->required("It's mandatory to send a file"); $result = $up->process(); // result->error contains error message
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2021-01-26