karls/media-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

karls/media-bundle

Composer 安装命令:

composer require karls/media-bundle

包简介

Bundle for Unite-Cms. Provides a new Field Type for handling S3 Stored files select from Storage and save it right.

README 文档

README

!! The config thumbnail_url is in the next version not available anymore. Please delete it in all your configs. !!

Provides a new Field Type for handling S3 Stored files select from Storage and save it right.

Installation

via composer

    composer require karls/media-bundle

in config/bundles.php

Karls\MediaBundle\KarlsMediaBundle::class => ['all' => true],

in config/packages/assets.yaml

framework:
    assets:
        packages:
            KarlsMediaBundle:
                json_manifest_path: "%kernel.project_dir%/public/bundles/karlsmedia/manifest.json"
                base_path: '/bundles/karlsmedia'

in config/routes/unite-cms.php

$routes->addCollection($loader->import("@KarlsMediaBundle/Resources/config/routing.$approach.yml"));

Usage

Media

unite cms does not manage any files directly but provides a file field that stores a reference using any s3 compatible API (Amazon, minio.io etc.). The file field renders an upload input element that allows the content editors to upload files directly to the s3 compatible server, using a presgined upload url. The file filed also reacts on content delete and update events and tries to delete files, that are not used anymore. In order to use the file field, set the required bucket and optional file_type settings:

{
  "type": "media",
  "settings": {
    "bucket": {
      "endpoint": "S3 Endpoint",
      "bucket": "S3 Bucket",
      "path": "myfiles"
    },
    "file_types": "txt,pdf,doc"
  }
}

MediaImage

The image type is an extension of the file input type that renders a thumbnail preview next to the upload input type and limits file_type to "png,gif,jpeg,jpg":

{
  "type": "mediaimage",
  "settings": {
    "bucket": { ... },
    //  read warning on top of wiki, has no function anymore but will be removed in the next version
    "thumbnail_url": "your_thumbnailing_service.com/{endpoint}/{id}/{name}"
  }
}

The optional thumbnail url allows you to add a link to the file directly or to any thumbnailing service. For a description of the bucket setting, please see the file type documentation.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-10-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固