tsdogs/yii2-fsmanager

简单文件管理器的模块

安装: 17

依赖: 0

建议: 0

安全性: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:yii2-extension

dev-master 2020-06-12 13:26 UTC

This package is auto-updated.

Last update: 2024-09-12 22:38:45 UTC


README

Latest Stable Version License Build Status Code Coverage Scrutinizer Code Quality Total Downloads

用于在文件系统中管理文件的扩展

演示

您可以在 krajee 网站上查看演示

安装

  1. 安装此扩展的首选方式是通过 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.

  2. 将模块添加到 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
    	]
    	...
    ]
  3. 请确保您在模块规则中指定了 maxFiles,在 AttachmentsInput 中指定了 maxFileCount,这两个值都是您希望的数量

变更日志

  • 2017年5月26日 - 初始版本