tsdogs / yii2-fsmanager
简单文件管理器的模块
dev-master
2020-06-12 13:26 UTC
Requires
- php: >=5.4.0
- kartik-v/yii2-dialog: ~1.0
- kartik-v/yii2-grid: ~3.1
- kartik-v/yii2-popover-x: ~1.0
- kartik-v/yii2-widget-fileinput: ~1.0.0
- yiisoft/yii2: ~2.0.0
Requires (Dev)
- phpunit/dbunit: ~1.0
- phpunit/phpunit: ~4.0
This package is auto-updated.
Last update: 2024-09-12 22:38:45 UTC
README
用于在文件系统中管理文件的扩展
演示
您可以在 krajee 网站上查看演示
安装
-
安装此扩展的首选方式是通过 composer。
运行以下命令之一:
php composer.phar require tsdogs/yii2-fsmanager "~1.0.0"
或者添加以下内容到您的
composer.json
文件中的 require 部分:"tsdogs/yii2-fsmanager": "~1.0.0"
to the require section of your composer.json file.
-
将模块添加到
common/config/main.php
'modules' => [ ... 'fsmanager' => [ 'class' => tsdogs\fsmanager\Module::className(), 'tempPath' => '@app/uploads/temp', 'publicPath' => '@app/uploads/store', 'rules' => [ // Rules according to the FileValidator 'maxFiles' => 10, // Allow to upload maximum 3 files, default to 3 'mimeTypes' => 'image/png', // Only png images 'maxSize' => 1024 * 1024 // 1 MB ], 'viewRoles' => ['@'], // roles able to view files 'uploadRoles' => ['admins'], // roles able to manage files ] ... ]
-
请确保您在模块规则中指定了
maxFiles
,在AttachmentsInput
中指定了maxFileCount
,这两个值都是您希望的数量
变更日志
- 2017年5月26日 - 初始版本