Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Editorjs Bundle Laravel Package

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).

View on GitHub
Deep Wiki
Context7

EditorjsBundle

Symfony bundle that integrates Editor.js primarily with Symfony Forms.

Installation

Symfony

  1. Download the package with composer: $ composer require tbmatuka/editorjs-bundle
  2. Add the bundle to bundles.php if it wasn't added automatically: Tbmatuka\EditorjsBundle\TbmatukaEditorjsBundle::class => ['all' => true],
  3. Copy the example package config file (examples/ediotrjs.yaml) or use it as an example to create your own configuration.
  4. Add the form theme to your twig configuration:
twig:
  form_themes:
    - '@TbmatukaEditorjs/Form/editorjs_widget.html.twig'

JavaScript

There is an example of the JS implementation in examples/editorjs-init.js.

Encore/webpack

If you're using Encore, you will need to install the npm package for Editor.js (@editorjs/editorjs) and any plugins that you want to use. Copy the example to your assets dir, add the plugin classes to the array and import the file from your main JS file.

Inline

Configuration options and examples will have to be added for other loading methods (like loading JS from the CDN or a local path inline in the widget), but they're not there for now.

Usage

Symfony Forms

You can use the EditorjsType in your forms to get Editor.js on the frontend. Data (decoded json) is returned as an array.

Twig

You can get an Editor.js config directly from the Twig extension. Check the form widget in src/Resources/views/Form/editorjs_widget.html.twig to see how to use it. The editorjs() Twig function accepts either a configuration object or just the name of a configuration that you want to use.

Contributing

Any kind of help is welcome, but especially information about the included JS not working in specific browsers. Please open an issue to discuss whatever you want to work on before you submit a pull request and avoid any kind of BC breaking changes unless they are agreed to in the issue discussion.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
boundwize/pyrameter
testo/facade
headercat/phpstan-extension-ide-helper
yosymfony/parser-utils
innmind/black-box
babenkoivan/elastic-migrations
babenkoivan/elastic-adapter
sandermuller/package-boost-php
sandermuller/boost-core
depa/sulu-google-reviews-bundle
croct/plug-symfony
develia/commons
dmstr/symfony-system-resources-bundle
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
renatomarinho/laravel-page-speed
develia/geo-bundle
austinheap/laravel-database-encryption
dreamzy/livewire-charts
touchestate-sdk/php-sdk