定制 abenmada/sylius-media-plugin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

abenmada/sylius-media-plugin

最新稳定版本:v1.0.2

Composer 安装命令:

composer require abenmada/sylius-media-plugin

包简介

The Media plugin provides a library to manage your media

README 文档

README

The Media plugin provides a library to manage your media

presentation photo presentation photo presentation photo presentation photo

Example

Here you will find example that allow you to add media to any form.

Installation

Require plugin with composer :

composer require abenmada/sylius-media-plugin

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

<?php

return [
    //..
    Abenmada\MediaPlugin\MediaPlugin::class => ['all' => true],
]

Then create the config file in config/packages/abenmada_media_plugin.yaml :

imports:
    - { resource: "@MediaPlugin/Resources/config/services.yaml" }

Then import the routes in config/routes/abenmada_media_plugin.yaml :

abenmada_media_plugin_routing:
    resource: "@MediaPlugin/Resources/config/routes.yaml"
    prefix: /%sylius_admin.path_name%

Update the entity src/Entity/Channel/Channel.php :

<?php

declare(strict_types=1);

namespace App\Entity\Channel;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Abenmada\MediaPlugin\Model\Channel\ChannelTrait as AbenmadaMediaChannelTrait;
use Sylius\Component\Core\Model\Channel as BaseChannel;

/**
 * @ORM\Entity
 * @ORM\Table(name="sylius_channel")
 */
class Channel extends BaseChannel
{
    use AbenmadaMediaChannelTrait;

    public function __construct()
    {
        $this->medias = new ArrayCollection();
        parent::__construct();
    }
}

Run the migration :

bin/console doctrine:migration:migrate

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

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