nowo-tech / ckeditor5-editor-bundle
Symfony form type for rich text using CKEditor 5 (GPL OSS build via Vite). FOS-style YAML profiles, Docker makefile workflow.
Package info
github.com/nowo-tech/CKEditor5EditorBundle
Type:symfony-bundle
pkg:composer/nowo-tech/ckeditor5-editor-bundle
Requires
- php: >=8.2 <8.6
- symfony/asset: ^7.4 || ^8.0
- symfony/config: ^7.4 || ^8.0
- symfony/dependency-injection: ^7.4 || ^8.0
- symfony/form: ^7.4 || ^8.0
- symfony/framework-bundle: ^7.4 || ^8.0
- symfony/html-sanitizer: ^7.4 || ^8.0
- symfony/http-foundation: ^7.4 || ^8.0
- symfony/http-kernel: ^7.4 || ^8.0
- symfony/security-csrf: ^7.4 || ^8.0
- symfony/twig-bundle: ^7.4 || ^8.0
- twig/extra-bundle: ^3.12
- twig/string-extra: ^3.12
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- igor-php/igor-php: ^0.10.0
- nowo-tech/phpstan-frankenphp: ^1.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^11.0
- rector/rector: ^2.0
- symfony/yaml: ^7.4 || ^8.0
- vincentlanglet/twig-cs-fixer: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v1.10.0
- v1.9.1
- v1.9.0
- v1.8.0
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.12
- v1.4.11
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-chore/req-wave2
- dev-chore/deps-2026-10-19
- dev-fix/coverage-html-sanitizer-tests
- dev-security/recipe-prod-sanitizer-docs
This package is auto-updated.
Last update: 2026-10-20 21:49:13 UTC
README
Found this useful? Install from Packagist · Star the repo on GitHub.
Symfony bundle: Ckeditor5EditorType stores HTML in a textarea while CKEditor 5 classic (GPL open-source plugins only) runs in the browser. YAML profiles (FOS-style), Vite IIFE build (ckeditor5-editor.js) under src/Resources/public/.
FrankenPHP demos: runtime is selected with FRANKENPHP_MODE (worker default, or classic for per-request PHP / hot-reload). See docs/DEMO-FRANKENPHP.md.
This bundle is FrankenPHP worker mode friendly (including reset_kernel: false / no kernel reset between requests). See FRANKENPHP-WORKER-AUDIT.md.
Features
- Named YAML profiles (
toolbar,min_height,form_theme,preset,theme, optionalupload_url). - Twig themes for common layouts (Bootstrap 3–5, Foundation, Tailwind 2, table layout).
nowo_ckeditor5_editor_script()Twig function: eager build or lazy loader (injects the 1 MB build only when an editor becomes visible — dialog opened, panel expanded, scrolled into view), editor CSS as a linked file (ckeditor5-editor.css, no injected<style>— strict CSP), CSP nonce, content-hash versioned URLs for long-lived caching.nowo_ckeditor5_editor_asset_url(),nowo_ckeditor5_editor_asset_path()andnowo_ckeditor5_editor_asset_package()Twig helpers for published assets (Symfony asset package).- pnpm + Vite frontend; Vitest coverage on
logger.tsand the lazy loader. - Dockerfile + Makefile aligned with other Nowo bundles.
- Demos: Symfony 8.1 FrankenPHP app under
demo/symfony8(port 8021).
Quick start
composer require nowo-tech/ckeditor5-editor-bundle:^1.0 php bin/console assets:install public
# config/packages/nowo_ckeditor5_editor.yaml nowo_ckeditor5_editor: default_profile: simple profiles: simple: preset: simple toolbar: true min_height: 240px form_theme: form_div_layout.html.twig debug: false theme: light
use Nowo\Ckeditor5EditorBundle\Form\Ckeditor5EditorType; $builder->add('body', Ckeditor5EditorType::class, [ 'label' => 'Article body', ]);
{{ nowo_ckeditor5_editor_script() }}
{# or, when the editor is not visible at first (modal, collapsed panel): #}
{{ nowo_ckeditor5_editor_script({lazy: true}) }}
Requirements
| Symfony | PHP (minimum) | Notes |
|---|---|---|
| 7.4 | 8.2+ | Tested in CI on 7.4 |
| 8.0, 8.1 | 8.4+ | Symfony 8 requirement; tested in CI on 8.0 and 8.1 |
Composer constraints: ^7.4 \|\| ^8.0 on Symfony components. See INSTALLATION.md.
Development
Requirements: Docker (recommended), or PHP 8.2+ with Composer + pnpm locally.
make up && make install # Docker PHP + composer + pnpm make assets # vite → src/Resources/public/ckeditor5-editor.js + ckeditor5-editor-loader.js make test # PHPUnit make test-ts # Vitest + coverage script make qa # cs-check + phpunit
Demos:
make -C demo up-symfony8
# http://localhost:8021 (see demo/README.md and PORT in .env)
Presets include standard, simple, minimal, emoji, typography, variables — see USAGE.md.
Documentation
- Installation
- Configuration
- Usage
- Contributing
- Code of Conduct
- Changelog
- Upgrading
- Release
- Security
- Engram
- Spec-driven development
- GitHub Spec Kit
Additional documentation
- PSR evaluation (REQ-CS-007)
- Demo with FrankenPHP (development and production)
- FrankenPHP worker audit (
reset_kernel: false) - GitHub Actions CI requirements
Tests and coverage
- Tests: PHPUnit (unit + integration) and Vitest (
logger.ts, lazy loader). Runmake test/composer testandmake test-ts. - PHP: 100%
- TS/JS: 100% (Vitest on
src/Resources/assets/src/logger.tsandckeditor5-editor-loader.ts; seevitest.config.ts). The CKEditor build entryckeditor5-editor.tsis excluded from the gate: it boots the real CKEditor 5 classic editor and is exercised through the demo instead (make demo-smokeand the/demo/variantspages). - Python: N/A
CI runs PHPUnit (matrix PHP 8.2–8.5 × Symfony 7.4 / 8.0 / 8.1), PHPStan, PHP-CS-Fixer dry-run, and Vitest coverage on pushes and pull requests.
License
MIT (bundle code). CKEditor 5 is used under its GPL / LGPL / commercial terms — this build uses OSS plugins suitable for GPL-compatible apps.
