yveveke/yveveke-gutenberg-bundle
Composer 安装命令:
composer require yveveke/yveveke-gutenberg-bundle
包简介
A Symfony bundle for EasyAdmin that provide a flexible content editor
README 文档
README
Easy Gutenberg Bundle
Provide Wordpress's Gutenberg Editor into Easyadmin.
Versions
| Repository Branch | Version | Symfony Compatibility | PHP Compatibility | Status |
|---|---|---|---|---|
2.x |
2.x |
5.4, and 6.x |
8.0.2 or higher |
New features and bug fixes |
Installation with Symfony Flex
Add our recipes endpoint
{
"extra": {
"symfony": {
"endpoint": [
"https://api.github.com/repos/agence-adeliom/symfony-recipes/contents/index.json?ref=flex/main",
...
"flex://defaults"
],
"allow-contrib": true
}
}
}
Install with composer
composer require agence-adeliom/easy-gutenberg-bundle
Documentation
Use GutenbergField
Go to your crud controller, example : src/Controller/Admin/PageCrudController.php
<?php namespace App\Controller\Admin; ... use App\Entity\EasyFaq\Entry; use App\Entity\EasyFaq\Category; abstract class PageCrudController extends AbstractCrudController { ... public function configureCrud(Crud $crud): Crud { return parent::configureCrud($crud) // Add the form theme ->addFormTheme('@EasyGutenberg/form/gutenberg_widget.html.twig') ; } public function configureFields(string $pageName): iterable { ... yield GutenbergField::new("content"); ...
Create a new Block
php bin/console make:gutenberg
Then setup your form field
<?php namespace App\Blocks; use Adeliom\EasyGutenbergBundle\Blocks\AbstractBlockType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; class TwoColsType extends AbstractBlockType { public function buildBlock(FormBuilderInterface $builder, array $options): void { $builder->add("left_col", TextType::class, ["label" => 'Left column content']); $builder->add("right_col", TextType::class, ["label" => 'Right column content']); } public static function getName(): string { return 'Two columns'; } public static function getDescription(): string { return 'Make a two columns layout'; } public static function getIcon(): string { return ''; } public static function getTemplate(): string { return "blocks/two_cols.html.twig"; } }
Frontend usage
In your template you can use these functions :
# This convert and render the content {{ easy_gutenberg(page.content) }} # This render the blocks's assets must be called after 'easy_gutenberg' {{ easy_gutenberg_assets() }}
Extra features
Add frontend assets
public static function configureAssets(): array { return [ 'js' => [], 'css' => [], 'webpack' => [], ]; }
Add backend assets
public static function configureAdminAssets(): array { return [ 'js' => [], 'css' => [], ]; }
Add extra form themes
public static function configureAdminFormTheme(): array { return []; }
Specify a category
The provided categories are:
- common
- text
- media
- design
- widgets
- theme
- embed
public static function getCategory(): string { return 'common'; }
Specify variations
public static function getVariations(): array { return [ [ "name": 'variation_with_bg', "isDefault": true, "title": "Variation With background", "icon": '', "attributes": [ "with-bg": true ], ] ]; }
Specify extra attributes
public static function getAttributes(): array { return [ "with-bg" => ['type' => 'boolean'] ]; }
Specify supports
Allowed supports are :
public static function getSupports(): array { return array_merge(parent::getSupports(),[ 'align' => false, ]); }
License
Authors
yveveke/yveveke-gutenberg-bundle 适用场景与选型建议
yveveke/yveveke-gutenberg-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 12 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「editor」 「easyadmin」 「flexible-content」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 yveveke/yveveke-gutenberg-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 yveveke/yveveke-gutenberg-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 yveveke/yveveke-gutenberg-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Symfony Media manager bundle for EasyAdmin
The bundle for easy using json-rpc api on your project
A Symfony simple blogging bundle for EasyAdmin
Adds more BBCode
Symfony Shop bundle for EasyAdmin based on Sylius
Bundle Symfony DaplosBundle
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-15