t-kanstantsin / yii2-fileupload
文件上传和存储工具
v1.2
2019-06-26 10:44 UTC
Requires
- php: >=7.1
- t-kanstantsin/fileupload: ^3.4
- yiisoft/yii2: ^2.0.10
Requires (Dev)
- codeception/codeception: ^2.3
- codeception/verify: ~0.3.1
- fzaninotto/faker: 1.5.*
Suggests
- fortawesome/font-awesome: For file types without preview generator
- ps/image-optimizer: Image optimization toolkit
This package is not auto-updated.
Last update: 2024-09-15 03:13:52 UTC
README
为 t-kanstantsin/fileupload 提供的 Yii2 小部件
配置
功能齐全的配置示例
<?php use \tkanstantsin\fileupload\FileManager; use \tkanstantsin\fileupload\formatter\Image; use \League\Flysystem\Adapter\Local as LocalFSAdapter; use \League\Flysystem\Filesystem; new FileManager([ 'uploadFS' => new Filesystem(new LocalFSAdapter(__DIR__ . '/tmp/upload', LOCK_EX, LocalFSAdapter::DISALLOW_LINKS)), 'cacheFS' => new Filesystem(new LocalFSAdapter(__DIR__ . '/tmp/web', LOCK_EX, LocalFSAdapter::DISALLOW_LINKS)), 'aliasArray' => [ 'attachment' => [ 'maxCount' => 1, ], ], 'formatterConfigArray' => [ 'attachment-gallery' => [ 'class' => Image::class, 'width' => 1920, 'height' => 1080, 'mode' => Image::RESIZE_INSET, ], 'attachment-preview' => [ 'class' => Image::class, 'width' => 300, 'height' => 150, 'mode' => Image::RESIZE_OUTBOUND, ], ], ]);