zenstruck/media-bundle

此包已弃用且不再维护。未建议替换包。

为Symfony2提供简单的媒体/文件管理GUI

资助包维护!
kbond

安装次数: 3,392

依赖者: 0

建议者: 0

安全性: 0

星标: 1

关注者: 2

分支: 1

开放问题: 1

类型:symfony-bundle

v0.2.0 2014-04-24 18:16 UTC

This package is auto-updated.

Last update: 2023-03-17 18:30:25 UTC


README

注意:此包正在积极开发中,请自行承担风险

为Symfony2提供简单的媒体/文件管理GUI

  • 与CKEditor集成
  • 带浏览服务器的媒体表单类型

Screenshot

查看示例源代码

安装

  1. 将其添加到您的composer.json

     composer require zenstruck/media-bundle
    
  2. 下载并安装AngularJS模块ngUpload到您的web/vendor文件夹。我建议使用Bower

     bower install ngUpload
    
  3. 可选 如果使用slugify文件名功能,请将cocur/slugify添加到您的composer.json

     composer require cocur/slugify
    
  4. 使用Symfony2注册此包

    // app/AppKernel.php
    
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Zenstruck\MediaBundle\ZenstruckMediaBundle(),
    
            // enable if you want to use the slugify filename feature
            // new Cocur\Slugify\Bridge\Symfony\CocurSlugifyBundle()
        );
        // ...
    }

完整默认配置

zenstruck_media:
    default_layout:       ZenstruckMediaBundle:Twitter:default_layout.html.twig
    slugify_filename_filter:  false
    filesystem_class:     Zenstruck\MediaBundle\Media\Filesystem
    media_form_type:      false
    role_permissions:     false
    filesystems:          # Required

        # Prototype
        name:
            root_dir:             %kernel.root_dir%/../web/files # Required
            web_prefix:           /files # Required
            secure:               false # set true and change the path to a non public path for secure file downloads

            # Comma separated list of extensions
            allowed_extensions:   ~ # Example: jpg,gif,png