darylseven/editorjs-bundle
Symfony bundle integrating Editor.js with Symfony Forms and Twig. Adds an EditorjsType form field, configurable editor setups, and a Twig helper to render/init the editor. Includes example config and JS init (Encore/webpack).
json type or custom accessors), adding minor complexity.twig.form_themes adjustments). Verify compatibility with Symfony 8’s new features (e.g., FormBuilder syntax).twig.form_themes registration in Symfony 8?FormBuilder::add() changes)?FormBuilder enhancements, Twig 3+ changes)?@editorjs/* plugins)?json type, custom accessors)?| Component | Fit | Notes |
|---|---|---|
| Symfony 8 Forms | Excellent | Explicitly supports Symfony 8’s form system, including validation and data binding. |
| Twig 3+ | Good | Requires form theme inclusion; limited customization without overrides. |
| Encore/Webpack | Required | Bundle assumes Encore for JS asset management; alternative setups undocumented. |
| Editor.js Plugins | Good (if using npm) | Plugins must be installed via npm; no CDN support documented. |
| Database | Manual Handling | JSON output requires custom handling (e.g., Doctrine json type). |
| API/SPA Use | Poor | Tied to Symfony Forms; not ideal for pure frontend apps or SPAs. |
| Symfony 7/6 | Limited | Bundle supports Symfony 7/6 via older releases, but Symfony 8 is primary focus. |
FormBuilder changes (e.g., add() syntax).twig.form_themes).npm install @editorjs/editorjs @editorjs/header @editorjs/paragraph
examples/editorjs-init.js to assets/js/editor-init.js and configure plugins.composer require tbmatuka/editorjs-bundle
config/bundles.php:
Tbmatuka\EditorjsBundle\TbmatukaEditorjsBundle::class => ['all' => true],
config/packages/editorjs.yaml (copy from examples/editorjs.yaml).twig:
form_themes: ['@TbmatukaEditorjs/Form/editorjs_widget.html.twig']
EditorjsType in Symfony 8 forms:
$builder->add('content', EditorjsType::class, [
'config' => ['tools' => ['header', 'paragraph']],
'mapped' => false, // If not binding directly to an entity property
]);
json_decode).editor-init.js in your Encore entry file:
import './editor-init';
json type or custom accessors:
#[ORM\Column(type: 'json')]
private array $content;
Json constraint or custom validators).v0.1.6 for Symfony 6), but Symfony 8 is the primary focus.How can I help you explore Laravel packages today?