承接 monsieurbiz/sylius-media-manager-plugin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

monsieurbiz/sylius-media-manager-plugin

最新稳定版本:v3.0.1

Composer 安装命令:

composer require monsieurbiz/sylius-media-manager-plugin

包简介

Add a media manager to your Sylius.

README 文档

README

Banner of Sylius Media Manager plugin

Sylius Media Manager

Media Manager Plugin license Tests Status Recipe Status Security Status

This plugin adds a media manager to your images, videos and other files type fields in Sylius.

Demo of the media manager

Compatibility

Sylius Version PHP Version
2.0, 2.1 8.2 - 8.3

ℹ️ For Sylius 1.x, see our 1.x branch and all 1.x releases.

Installation

If you want to use our recipes, you can configure your composer.json by running:

composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'

Install the plugin via composer:

composer require monsieurbiz/sylius-media-manager-plugin

Change your config/bundles.php file to add this line for the plugin declaration:

<?php

return [
    //..
    MonsieurBiz\SyliusMediaManagerPlugin\MonsieurBizSyliusMediaManagerPlugin::class => ['all' => true],
];

Copy the plugin configuration files in your config folder: https://github.com/monsieurbiz/symfony-recipes/tree/master/monsieurbiz/sylius-media-manager-plugin/3.0/config

Add these variables to your .env :

MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_PUBLIC_FOLDER=%kernel.project_dir%/public
MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_ROOT_FOLDER_FROM_PUBLIC=media
MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_MAX_FILE_SIZE=5M

Copy the templates in the folder dist/templates/ to ensure that form fields are rendered correctly:

cp -R vendor/monsieurbiz/sylius-media-manager-plugin/dist/templates/bundles/* templates/bundles/

Copy the form extension if you want to use it on your product images.

cp -R vendor/monsieurbiz/sylius-media-manager-plugin/dist/src/Form/Extension/ProductImageTypeExtension.php src/Form/Extension/ProductImageTypeExtension.php

Else remove the file templates/bundles/SyliusAdminBundle/product/form/sections/media/images.html.twig

Use form types

You can check the dist folder to check how the plugin is setup on the test application.

Images

Use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\ImageType

PDF

Use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\PdfType

Video

Use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\VideoType

Favicon

Use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\FaviconType

Audio

Use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\AudioType

Configuration

You can specify the default maximum file size allowed for the media manager by setting the MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_MAX_FILE_SIZE environment variable.

Is it possible to define a maximum file size for each form type by define the MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_MAX_FILE_SIZE_{TYPE} environment variable. Example: MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_MAX_FILE_SIZE_IMAGE=1M will set the maximum file size for the image type to 1M.

Contributing

You can find a way to run the plugin without effort in the file DEVELOPMENT.md.

Then you can open an issue or a Pull Request if you want! 😘
Thank you!

License

This plugin is completely free and released under the MIT License.

统计信息

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

GitHub 信息

  • Stars: 16
  • Watchers: 1
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-05