linestorm/media-bundle

此包已被废弃,不再维护。未建议替代包。
此包最新版本(dev-master)的许可证信息不可用。

symfony 2.3 媒体包

dev-master 2014-07-10 22:20 UTC

This package is auto-updated.

Last update: 2020-04-10 17:18:27 UTC


README

Build Status

LineStorm CMS 的媒体模块包提供了CMS的图片管理功能

安装

  1. 使用composer下载bundle
  2. 启用Bundle
  3. 配置Bundle
  4. 安装资源
  5. 配置资源

第1步:使用composer下载bundle

linestorm/media-bundle 添加到您的 composer.json 文件中,或者通过运行以下命令下载:

$ php composer.phar require linestorm/media-bundle

第2步:启用Bundle

app/AppKernel.php 中启用媒体bundle

public function registerBundles()
{
    $bundles = array(
        // ...
        new LineStorm\MediaBundle\MediaBundle(),
    );
}

第3步:配置Bundle

app/config/config.yml 文件中的 linestorm_cms_media 命名空间内添加默认的媒体提供者。默认为 local_storeage

line_storm_media:
  default_provider: local_storeage

如果您想使用 local_storage,则需要将其添加到您的 Resources/config/services.yml 文件中

parameters:
  linestorm.cms.media_provider.local_storeage.entity.class: Acme\DemoBundle\Entity\Media

services:
  linestorm.cms.media_provider.local_storeage:
        class: LineStorm\MediaBundle\Media\LocalStorageMediaProvider
        arguments:
            - @doctrine.orm.default_entity_manager
            - %linestorm.cms.media_provider.local_storeage.entity.class%
            - @security.context
            - /path/to/store/directory/
            - /web/path/
        tags:
            - { name: linestorm.cms.media_provider }

请参阅 创建媒体提供者 以创建您自己的提供者。

第4步:安装资源

###Bower 将 .bower.json 添加到依赖项

###手动下载 .bower.json 中的模块到您的资源文件夹

第5步:配置资源

您需要将这些依赖路径添加到您的 requirejs 配置中

requirejs.config({
    paths: {
        // ...

        // cms media library
        cms_media:          '/path/to/bundles/linestormmedia/js/media',
        cms_media_list:     '/path/to/bundles/linestormmedia/js/list'
    }
});