定制 skylineos/yii2-s3manager 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

skylineos/yii2-s3manager

最新稳定版本:4.1.6

Composer 安装命令:

composer require skylineos/yii2-s3manager

包简介

A yii2 extension for managing files in AWS S3 buckets

README 文档

README

A Yii 2 extension for managing files in AWS S3 buckets


This extension provides a very customizable method for managing files in AWS S3 buckets for the Yii framework 2.0. It can function on it's own, as a callback for a form field, or integrated with TinyMCE.

For license information check the LICENSE-file.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist skylineos/yii2-s3manager

or add

"skylineos/yii2-s3manager": "~3.0.0"

to the require section of your composer.json.

Configuration

To use this extension, you should add the module to your web configuration. Configuration of the module itself can be done here or on the fly.

return [
    //....
    'modules' => [
        's3manager' => [
            'class' => 'skylineos\yii\s3manager\Module',
            // All settings can be configured on the fly regardless of usage type (fileinput, standalone manager, tinymce plugin)
            'configuration' => [ 
                'bucket' => 'your-bucket-name', // can be overriden with \Yii::$app->params['s3bucket']
                'version' => 'latest',
                'region' => 'your-bucket-region', // can be overriden with \Yii::$app->params['s3region']
                'scheme' => 'http',
            ],            
        ],
    ]
];

Be certain to check the widgets folder for exposed parameters.

Use

Standalone

Simply navigate to /s3manager

With a file input (active form)

In your form, add the following (ie. views/post/form.php)

use skylineos\yii\s3manager\widgets\{FileInput, MediaManagerModal};

Wherever you want your form field:

<label>My Field</label>
<?= FileInput::widget(['model' => $model, 'attribute' => 'myField']) ?>

Then, at the bottom of the page (after your <?php ActiveForm::end(); ?>) <?= MediaManagerModal::widget(['s3region' => 'us-east1', 's3bucket' => 'my-bucket-name']) ?>

With TinyMCE

On your form.php

use skylineos\yii\s3manager\widgets\{TinyMce, MediaManagerModal};

Wherever you want your TinyMCE (client options are largely up to you):

<?= $form->field($model, 'content')->widget(TinyMce::className(), [
    'options' => ['rows' => 15],
    'clientOptions' => [
        'plugins' => [
            "advlist autolink lists link charmap print preview anchor",
            "searchreplace visualblocks code fullscreen",
            "insertdatetime media table contextmenu paste image"
        ],
        'menubar' => 'edit insert view format table tools help',
        'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
    ]
]);?>

Then, at the bottom of the page (after your <?php ActiveForm::end(); ?>) <?= MediaManagerModal::widget(['s3region' => 'us-east1', 's3bucket' => 'my-bucket-name']) ?>

统计信息

  • 总下载量: 278
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 3
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2021-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固