abenmada/sylius-backoffice-plugin

后端插件允许您更改后端颜色和渠道标志


README

后端插件允许您更改后端颜色和渠道标志

presentation photo

安装

使用Composer安装插件

composer require abenmada/sylius-backoffice-plugin

修改 config/bundles.php 文件以添加插件的行

<?php

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

然后在 config/packages/abenmada_backoffice_plugin.yaml 中创建配置文件

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

更新实体 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\BackofficePlugin\Model\Channel\ChannelTrait as AbenmadaBackofficeChannelTrait;
use Sylius\Component\Core\Model\Channel as BaseChannel;
use Sylius\Component\Core\Model\ImagesAwareInterface;

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

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

运行迁移

bin/console doctrine:migration:migrate