proxilog/proxicms-content-bundle

此包已被废弃,不再维护。未建议替代包。

ProxiCMS 内容包的 Symfony

0.1.1 2022-06-22 12:14 UTC

This package is not auto-updated.

Last update: 2022-08-03 16:01:27 UTC


README

Latest Stable Version

/!\ 警告,请注意,直到版本 1.0.0,可能会引入一些破坏性变更

此包允许您管理 ProxiCMS 的内容。

待办事项

  • 创建 食谱 安装
  • 更好地使用迁移?(有任何想法吗?)
  • 在包中创建测试(而不是应用侧)

使用

EasyAdmin

它将提供一个可以管理的文本编辑器。

Twig

当您使用 twig 获取内容时,它将根据其标识符创建或获取当前内容。

  • 使用标识符 proxicms_content_obj('identifier') 获取 Content 对象
  • 使用标识符 proxicms_content_val('identifier') 获取值

安装

此包需要 PHP 8.1 或更高版本和 Symfony 6.1 或更高版本。

步骤 1:使用 composer 安装包

$ composer require proxilog/proxicms-content-bundle

步骤 2:将包添加到 bundles.php

// config/bundles.php
return [
    //..
    ProxiCMS\ContentBundle\ProxiCMSContentBundle::class => ['all' => true],
];

步骤 3:在 EasyAdmin 仪表板中添加菜单项

// src/Controller/Admin/DashboardController.php
public function configureMenuItems(): iterable
    {
        //...
        yield MenuItem::linkToCrud('Contenus', 'fas fa-pager', Content::class)
                    ->setController(ContentCrudController::class);
    }

或者您可以创建自己的 ContentCrudController 并扩展此控制器。

步骤 4:在您的应用中添加迁移

# config/doctrine_migrations.yaml
doctrine_migrations:
    migrations:
        - 'ProxiCMS\ContentBundle\Migrations\MySQL0100'