yii2-extensions/filepond
Composer 安装命令:
composer require yii2-extensions/filepond
包简介
FilePond Widget for Yii Framework.
README 文档
README
FilePond.
Installation
The preferred way to install this extension is through composer.
Either run
composer require --dev --prefer-dist yii2-extensions/filepond
or add
"yii2-extensions/filepond": "dev-main"
to the require-dev section of your composer.json file.
Usage
Name
use Yii2\Extensions\Filepond\FilePond; echo FilePond::widget(['name' => 'image_file']);
Active Field
use Yii2\Extensions\Filepond\FilePond; echo $form ->field($formModel, 'image_file') ->widget( FilePond::class, [ 'loadFileDefault' => $imageFile, 'imagePreviewHeight' => 170, 'imageCropAspectRatio' => '1:1', ], );
Controller or Model
use Yii2\Extensions\Filepond\FileProcessing; $imageFile = FileProcessing::saveWithReturningFile( $categoryForm->image_file, Yii::getAlias('@uploads'), "category{$category->id}", false );
Properties of the widget
| Property | Type | Description | Default |
|---|---|---|---|
acceptedFileTypes |
string |
The accepted file types. Can be mime types or wild cards. | [] |
allowFileTypeValidation |
bool |
Whether to allow file type validation. | true |
allowFileRename |
bool |
Whether to allow file rename. | false |
allowFileValidateSize |
bool |
Whether to allow file size validation. | true |
allowImageCrop |
bool |
Whether to allow image crop. | false |
allowImageExifOrientation |
bool |
Whether to allow image exif orientation. | true |
allowImagePreview |
bool |
Whether to allow image preview. | true |
allowImageTransform |
bool |
Whether to allow image transform. | false |
allowMultiple |
bool |
Whether to allow multiple files. | false |
allowpdfPreview |
bool |
Whether to allow pdf preview. | false |
cssClass |
string |
The css class of the widget. | '' |
cdn |
boolean |
Whether to use the CDN. | true |
config |
array |
The config of the widget. | [] |
fileRename |
string |
The file rename. | '' |
use: fileRenameFunction: (file) => return my_new_name${file.extension}`; |
|||
fileValidateTypeDetectType |
string |
The file validate type detect type function. | '' |
fileValidateTypeLabelExpectedTypes |
string |
The file validate type label expected types. | '' |
imageCropAspectRatio |
string,null |
The image crop aspect ratio. | null |
imagePreviewHeight |
string,null |
The image preview height. | null |
imagePreviewMarkupShow |
bool |
Whether to show the image preview markup. | true |
imagePreviewMaxFileSize |
string,null |
The image preview max file size. | null |
imagePreviewMaxHeight |
int |
The image preview max height. | 256 |
imagePreviewMaxInstantPreviewFileSize |
int |
The image preview max instant preview file size. | 10000000 |
imagePreviewMinHeight |
int |
The image preview min height. | 44 |
imagePreviewTransparencyIndicator |
string,null |
The image preview transparency indicator. | null |
imageTransformAfterCreateBlob |
array,null |
The image transform after create blob. | null |
imageTransformBeforeCreateBlob |
array,null |
The image transform before create blob. | null |
imageTransformOutputQuality |
int,null |
The image transform output quality. | null |
imageTransformClientTransforms |
array,null |
The image transform client transforms. | null |
imageTransformOutputQualityMode |
string,null |
The image transform output quality mode. | añways |
imageTransformOutputStripImageHead |
bool |
The image transform output strip image head. | true |
imageTransformVariants |
array,null |
The image transform variants. | null |
imageTransformVariantsIncludeDefault |
bool |
The image transform variants include default. | true |
imageTransformVariantsDefaultName |
string,null |
The image transform variants default name. | null |
imageTransformVariantsIncludeOriginal |
bool |
The image transform variants include original. | false |
labelIdle |
string |
The label idle. | '' |
labelMaxFileSize |
string |
The label max file size. | '' |
labelMaxFileSizeExceeded |
string |
The label max file size exceeded. | '' |
labelMaxTotalFileSize |
string |
The label max total file size. | '' |
labelMaxTotalFileSizeExceeded |
string |
The label max total file size exceeded. | '' |
labelFileTypeNotAllowed |
string |
The label file type not allowed. | '' |
loadFileDefault |
string |
The load file default. | '' |
maxFiles |
int |
The max files. | 1 |
maxFileSize |
string,null |
The max file size. | null |
maxTotalFileSize |
string,null |
The max total file size. | null |
minFileSize |
string,null |
The min file size. | null |
pluginDefault |
array |
The plugins default. | [ |
FilePondPluginFileValidateType, |
|||
FilePondPluginFileValidateSize, |
|||
FilePondPluginFileValidateType, |
|||
FilePondPluginImageExifOrientation, |
|||
FilePondPluginImagePreview, |
|||
] |
|||
pdfPreviewHeight |
int |
The pdf preview height. | 320 |
pdfComponentExtraParams |
string |
The pdf component extra params. | toolbar=0&view=fit&page=1 |
required |
bool |
Whether the field is required. | false |
Translation support
The extension supports translation. You can translate the extension into your language, for default the extension supports the following languages:
- Chinese
- English
- French
- German
- Poland
- Portuguese
- Russian
- Spanish
Quality code
Support versions Yii2
Testing
Check the documentation testing to learn about testing.
Our social networks
License
The MIT License. Please see License File for more information.
yii2-extensions/filepond 适用场景与选型建议
yii2-extensions/filepond 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 636 次下载、GitHub Stars 达 2, 最近一次更新时间为 2023 年 11 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「widget」 「yii2」 「filepond」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 yii2-extensions/filepond 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 yii2-extensions/filepond 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 yii2-extensions/filepond 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A custom URL rule class for Yii 2 which allows to create translated URL rules
Use FilePond fields in SilverStripe
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
Upload files using Symfony Form, FilePond, and the rekalogika/file framework
Add a weather widget to Flarum
Arikaim CMS Filepond UI library
统计信息
- 总下载量: 636
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 15
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: mit
- 更新时间: 2023-11-16
