development-x/media-bundle

Symfony 3 媒体组件管理器

安装: 27

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 2

分支: 1

类型:symfony-bundle

1.0.0 2017-04-23 09:24 UTC

This package is auto-updated.

Last update: 2024-09-16 01:11:44 UTC


README

MediaBundle 是用于管理实体文件的媒体库。使用时请自行承担风险。

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock

特性

  • 通过 DoctrineORM 将上传的文件保存到数据库
  • 所有设置、模板和翻译都可以高度自定义

安装

步骤1:下载组件

此命令要求您全局安装了 Composer,请参考 Composer 文档中的安装章节

$ composer require development-x/media-bundle "~1"

步骤2:启用组件

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new MediaBundle\MediaBundle(),
        );

        // ...
    }

    // ...
}

步骤3:编辑 config.yml 配置

twig:
    form_themes:
        - 'MediaBundle:Form:fields.html.twig'

步骤4:安装 bootstrap-fileinput js 插件

插件安装说明请参考这里。安装完成后,只需加载 js 和 css 文件。

<link type="text/css" href="{{ asset('library/bootstrap-fileinput/css/fileinput.min.css') }}" rel="stylesheet" media="all" />
<script type="text/javascript" src="{{ asset('library/bootstrap-fileinput/js/fileinput.min.js') }}"></script>

更多配置

贡献

但是,如果您有兴趣并希望提交错误修复、新功能或更好的实现,请发送拉取请求:)

许可协议

此组件遵循 MIT 许可协议。完整的许可协议请参阅组件中的许可文件